DIGIT-ARC read-only archive · snapshot: July 23, 2026

Option to choose Yes/no to run a batch file in Scheduler!!

4 posts · originally from https://geek.digit.in/community/threads/option-to-choose-yes-no-to-run-a-batch-file-in-scheduler.123174/

hansraj
hansraj Original post #1
Dec 11, 2009 at 3:50 PM
Friends...I want to run a batch file through the task scheduler. Now this batch file is to hibernate my system in my absence. When I am working on the system I want a prompt to appear for some time which gives me an option of choosing yes/no. Also if yes/no is not given a reply the batch file to hibernate the system should run after specific time period.
Is this possible? If yes, how!!!
CA50
CA50 #2
Dec 11, 2009 at 10:43 PM
Sory i cant help with this but i hav an alternative, go to power option in xp, there is an option to hibernate da pc after a specific time. Note that you hav to enable hibernate.
hansraj
hansraj #3
Dec 12, 2009 at 8:51 AM
@ca50
thanks a lot for the generous reply. Found an alternate method. This is the code I am using to achieve my solution.


@Echo off
echo .
echo ..
echo ...Close this window or else...
echo ...the system will hibernate in 45 seconds
echo Countdown has already begun!!!
PING -n 45 127.0.0.1>nul
rundll32 powrprof.dll,SetSuspendState


I have written this code and saved it as a hibernate.bat file and its working fine for me. May be this post helps someone else too.
CA50
CA50 #4
Dec 12, 2009 at 11:40 PM
^^^^^^^^^^^^^^gud wrk