Saving input from batch into text file [Partially complete]
Posted: 06 Feb 2010 02:03
Hi,
i would like to save some data into a text file, so far i have.
@cls
@:COMPUTERNAME
@set /p ComputerN=What is the Computer Name?
@set /p yn=Are you sure [y/n]?
@if "%yn%"=="" (echo Not entry) & (GOTO COMPUTERNAME)
@if /I "%yn%"=="n" (GOTO COMPUTERNAME)
@if /I "%yn%"=="y" (GOTO HAMACHIC) else (echo Invalid Entry) & (GOTO FILENAME)
@:HAMACHIC
@pause
@echo "ComputerName %ComputerN" > test.txt
@echo "AutoNetwork <BNS_VPN>" >> test.txt
@echo "AutoPassword <password>" >> test.txt
@echo "ChatColorLogBack 000000" >> test.txt
@echo "ChatColorLogFore FFFFFF" >> test.txt
@echo "ChatColorLogSelf 528B8B" >> test.txt
@echo "ChatColorLogPeer CFDBC5" >> test.txt
@echo "ChatColorLogSystem CC99CC" >> test.txt
@echo "ChatColorLogNetwork C2C2C2" >> test.txt
@echo "ChatColorLogHistory CDCDCD" >> test.txt
@echo "NoTrayBalloons 1" >> test.txt
@pause
i can't have the "" in the file, if i take them out i get errors because of >'s in the data.
Thanks
i would like to save some data into a text file, so far i have.
@cls
@:COMPUTERNAME
@set /p ComputerN=What is the Computer Name?
@set /p yn=Are you sure [y/n]?
@if "%yn%"=="" (echo Not entry) & (GOTO COMPUTERNAME)
@if /I "%yn%"=="n" (GOTO COMPUTERNAME)
@if /I "%yn%"=="y" (GOTO HAMACHIC) else (echo Invalid Entry) & (GOTO FILENAME)
@:HAMACHIC
@pause
@echo "ComputerName %ComputerN" > test.txt
@echo "AutoNetwork <BNS_VPN>" >> test.txt
@echo "AutoPassword <password>" >> test.txt
@echo "ChatColorLogBack 000000" >> test.txt
@echo "ChatColorLogFore FFFFFF" >> test.txt
@echo "ChatColorLogSelf 528B8B" >> test.txt
@echo "ChatColorLogPeer CFDBC5" >> test.txt
@echo "ChatColorLogSystem CC99CC" >> test.txt
@echo "ChatColorLogNetwork C2C2C2" >> test.txt
@echo "ChatColorLogHistory CDCDCD" >> test.txt
@echo "NoTrayBalloons 1" >> test.txt
@pause
i can't have the "" in the file, if i take them out i get errors because of >'s in the data.
Thanks