?
Solved

AT batch file to stop today and restart tomorrow?

Posted on 2007-08-07
8
Medium Priority
?
313 Views
Last Modified: 2010-04-16
basically im making a system to shutdown a pc at a given time, to limit interaction for the user i want them to be able to click a shortcut that will stop the AT command and start the scheduled task tomorrow by default.
for example if they need to leave their computer on overnight

e.g. PC set to switch off every night at 8pm

batch file
at 20:00 /interactive /every:m,t,w,th,f,s,su c:\shutdownscript.bat

if they want they can click a file which will delete all the AT Ids and start the process from tomorrow,

at /delete /yes

what i need is the next line of command that will readd it but wont start it today i.e. its rescheduled to run from tomorrow as they could click this file before 8pm and so it would start the process again today

Thanks

Superblades
0
Comment
Question by:superblades
  • 6
  • 2
8 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 19649484
how about an AT command that runs another AT command to re-enable the nightly reboot.
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 19649510
at /delete /yes
at 20:00 /interactive at 20:00 /interactive /every:m,t,w,th,f,s,su c:\shutdownscript.bat


0
 
LVL 33

Expert Comment

by:knightEknight
ID: 19649513
... except that the first AT should run at 20:01 instead of 20:00
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
LVL 33

Expert Comment

by:knightEknight
ID: 19659537
Does this help solve your problem?
0
 
LVL 4

Author Comment

by:superblades
ID: 19754443
if i run the above at 18:00 though it will still run at 20:00 - what i want it to do is if i run it as 18:00 it wont run again until 20:00 the following day
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 19754527
why run it at 18:00?  

>> i want them to be able to click a shortcut that will stop the AT command and start the scheduled task tomorrow by default.

Simply have the batch file create the task at 20:01 today, which, when it runs at 20:01, will create the task for tomorrow and all following days.  This is the batch file the use clicks on -- and it will create the task at 20:01 regardless of what time of day the user clicks on it (18:00 or otherwise).

  at /delete /yes
  at 20:01 /interactive at 20:00 /interactive /every:m,t,w,th,f,s,su c:\shutdownscript.bat

However, as it is now, if the user clicks on it after 20:01, the next day will be skipped.  Is this a problem?  If so, I'm sure the solution won't be difficult...
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 2000 total points
ID: 19754550
>> if i run the above at 18:00 though it will still run at 20:00 - what i want it to do is if i run it as 18:00 it wont run again until 20:00 the following day

If you run the command at 18:00 today, what will run at 20:01 is the AT job to create tomorrow's AT job at 20:00.  Does this make sense?
0
 
LVL 4

Author Comment

by:superblades
ID: 19754696
your right my bad

thanks for your help!
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Loops Section Overview
Screencast - Getting to Know the Pipeline
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question