Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do you schedule a task to run a batch file at a certain time/within a certain amount of minutes? I'd use at 12:34 C:\example.bat but unfortunately the AT command is deprecated.. I'd like to use it so that my hotspot disables after e.g. 30 minutes or at midnight. The .bat file executes this amongst others: netsh wlan disable hostednetwork. I believe it is not possible to schedule a single command line is it? In that case that would be even better.

thanks for any help.

share|improve this question
    
Not really sure what you are asking. The last command you list can be scheduled using the answer given by @LPChip. In the scheduler, add an action put netsh in the command and the parameters in the arguments field. You might need to work out what folder netsh is in. –  Julian Knight May 9 at 20:37
    
I had a question that asked this and got some pretty good answers, but it's apparently been deleted. But Task Scheduler is your friend. –  Daniel R Hicks May 9 at 21:02

1 Answer 1

Just schedule it using Control Panel->Administrative tools->Task Scheduler.

It has all the options you need.

Also, if it is just one command in the .bat file, you can schedule just this task using Task Scheduler. Enter netsh as program and wlan disable hostednetwork as its parameters.

share|improve this answer
    
thanks but yes i know that and i've tried that to see if it works(it does). But i need a command line which does it. –  Bart May 9 at 20:16
3  
You can start or create scheduled tasks from the commandline as well using C:\Windows\System32\schtasks.exe /Run or /Create. See C:\Windows\System32\schtasks.exe /? for more info. –  LPChip May 9 at 20:21
    
okay thanks! so how would you create the command which executes example.bat after 30 minutes? or at 12:00 hours? –  Bart May 9 at 20:38
    
@Bart - Study the Task Scheduler options -- you can have the command execute at a given time, after a given delay, repeat with a given frequency, etc. –  Daniel R Hicks May 9 at 21:03
    
yes but i don't know how to interpret that syntax properly i'm just playing around with batch programming. i've already got two entire days of experience :P –  Bart May 9 at 21:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.