I am currently trying to write a script that will shut down a XP based computer at a certain time to save energy by preventing it being left on overnight. However I don't want it to force a shut down if the computer is still in use so a button to cancel would be required. Now I have absolutely no clue when it comes to programming / writing scripts, so what I currently have is all sourced from google.
This is what I have
@Shutdown -s -t 300 -c "This Computer will shut down in 5 minutes to save energy. If you are currently working please click yes on the abort window to cancel"
@echo off
echo Set objshell = CreateObject("wscript.shell") > %temp%\abort.vbs
However my problem is that the pop-up with the abort yes/ no buttons appears directly behind the shut down timer so wont be seen. How can I customise this to move the box lower or place it on top. The command prompt also appears, so it would look neater to hide this also but no essential .
Question
anthdci
I am currently trying to write a script that will shut down a XP based computer at a certain time to save energy by preventing it being left on overnight. However I don't want it to force a shut down if the computer is still in use so a button to cancel would be required. Now I have absolutely no clue when it comes to programming / writing scripts, so what I currently have is all sourced from google.
This is what I have
@Shutdown -s -t 300 -c "This Computer will shut down in 5 minutes to save energy. If you are currently working please click yes on the abort window to cancel"
@echo off
echo Set objshell = CreateObject("wscript.shell") > %temp%\abort.vbs
echo strAnswer = MsgBox("abort shutdown ?",vbYesNo) >> %temp%\abort.vbs
echo If strAnswer = 6 Then >> %temp%\abort.vbs
echo objshell.Run("shutdown -a") >> %temp%\abort.vbs
echo End if >> %temp%\abort.vbs
%temp%\abort.vbs
However my problem is that the pop-up with the abort yes/ no buttons appears directly behind the shut down timer so wont be seen. How can I customise this to move the box lower or place it on top. The command prompt also appears, so it would look neater to hide this also but no essential .
Thanks.
Link to comment
Share on other sites
13 answers to this question
Recommended Posts