I am in need of assistance. I have a batch file that restarts machines on a nightly basis. However, since the Windows 7 "Shutdown" command doesn't log remarks unless there is an issue, I need some assistance. Here's my batch file:
FOR /F "tokens=*" %%A IN ('TIME/T') DO SET Now=%%A
for /f %%i in (
) do (
>>c:\scripts\output.txt 2>&1 Echo Restarting of machines initiated on %date% @ %now%
>>c:\scripts\output.txt 2>&1 SHUTDOWN /r /m \\%%i /t %1 /c "This machine is forcibly restarting in %1 seconds!" /f
>>c:\scripts\output.txt 2>&1 Echo .
The hosts file is about 290 machine names listed each on a separate line. If possible, I would like to get each machine name listed in the output.txt file as well, even if it's a simple line showing the machine name and that's it. That way, I can compare the running script with the machine listing I have, to make sure each and every machine is in there.
Is this something easy?