Justin Collins
asked on
Make a batch file write to notepad document.
I am creating a batch file that runs through 6 different autoinstalls. Is there any way to have the batchfile write to a notepad document after each individual install to verify everything installed correctly?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry.
Did you get it working? Can put it anywhere, or use at as a subroutine e.g. in XP:
@echo off
setlocal
set F=logfile.txt
::...statements to do install etc
::then call sub
call :message "My message"
::...more statements for install etc.
::then call sub again
call :message "My message 2"
goto :eof
:message
set msg=%1
echo. >> %F%
echo %date% %time% >> %F%
echo. >> %F%
echo %msg% >> %F%
goto :eof
Did you get it working? Can put it anywhere, or use at as a subroutine e.g. in XP:
@echo off
setlocal
set F=logfile.txt
::...statements to do install etc
::then call sub
call :message "My message"
::...more statements for install etc.
::then call sub again
call :message "My message 2"
goto :eof
:message
set msg=%1
echo. >> %F%
echo %date% %time% >> %F%
echo. >> %F%
echo %msg% >> %F%
goto :eof
ASKER