How to schedule a Batch File to run automatically in Windows 10 / 8 / 7

There are occasions where you might need to schedule to run a batch file automatically in your Windows. In this article I’ll suggest a tip on how to schedule a batch file automatically using Task Scheduler.

Schedule a Batch File to run automatically

Step 1: Create a batch file you wish to run and place it under a folder where you have enough permissions. For example under C drive.

Step 2: Click on Start and under search, type in Task and click open Task Scheduler.

Step 3: Select Create Basic Task from the Action pane on the right of the window.

Step 4: Under Create Basic Task, type in the name you like and click Next.

Step 5: From the Trigger select the option you like and click Next.

I chose Daily and clicked Next, which brought me to this screen.

Step 6: Then click on Start a Program and click Next.

Step 7: Now click on Browser and select the batch file you like to run.

Step 8: Finally, click on Finish to create the Task.

Now that we have created a Task, we have to make sure it runs with the highest privilege. Since we have UAC settings we have to make sure that when you run the file it should not fail if it does not bypass the UAC settings.

So click on Task Scheduler Library.

Then double click on the Task you just created.
Step 8: Click on Run with Highest privilege then click OK.

Congratulations!  You have successfully created a Scheduled Task to automate a batch file.

Posted by on , in Category Windows with Tags
Shyam aka “Captain Jack” is a Microsoft MVP alumnus and a Windows Enthusiast with an interest in Advanced Windows troubleshooting. Suggestions made and opinions expressed by him here are his personal one's and not of his current employers. He blogs at
  • PC Support

    this is exactly what i was looking for. thx!

  • Onlypq

    Hi, not sure if you can help; My batch file is kicking of a powershell script, it starts the script then it hangs.
    Do you know what could be the problem

  • Guest

    Thank you!

  • Maryia30b

    thank you so much))))

  • Oliverofthenight

    Does not work.
    Followed instructions exactly
    Getting error: “Windows cannot find ‘file.bat’.
    The pathing is correct.

  • Ashok Sahu

    Hey Thankxxx a lot for sharing this idea…

  • Afdsa

    Thanks!!! Great Help….

  • Arun

    Thank you, it worked……….

  • alex

    on windows 8 it runs in background and is a pain in the butt to make run on foreground. Please help

  • Mahesh Kumar A

    thanks bro.

  • LightnLar

    Thanks for the explanation, my batch file works now.

  • rohitbindal

    How to give the destination folder path for backup tasks

  • KCR

    Exactly what I was looking for! Thank You!

  • Andrei

    Simply great!

  • Mostafa Amine

    this was helpful n clear, thanks for your help! :)

  • luuz

    wooow it is cool
    auto virus runer created

  • Jake Roberts

    Very nice Tutorial. How to make it run several times a day on it’s on (Scheduled) and what is the Hidden for?

  • Lilian

    can not recognize the shared drive when i was trying to export a file. if I double click the .bat file, it works, but did not work through task schedule. Any help will be much appreciated!

  • Roberto Lenti

    Don’t work, the task won’t start even if i stat it manually on task scheduler.
    Starting the bat on dos prompt run perfectly.

  • Roberto Lenti

    Don’t work!
    The task in log result as started but i don’t see the effects.
    If i run the batch manualli it’s work perfectly.

  • Karthik Munukuntla

    The scheduler runs every night.. and it currently updates the created file. I want to create a new file every time the scheduler is run… Could you help me with this..!!

  • Guest

    i am using UNC path for backup script to store on different server.The task runs without errors but output file is not created.

  • smoothblood


  • Manish SHIRODE

    Go to task propeties… Triggers tab… there you will see option to schedule it on hourly basis

  • Gary Pearman

    Thanks Captain, 8.1 was hijacking my grub. Now, I’ll just run a script at start up. There’s three days I’ll never get back.

  • DJ

    Hi, I created a task to execute a batch file which has sqlcmd to execute a stored proc. If I run the batch file manually, it works as expected. According to the history, The task starts at scheduled time and completes successfully. The stored procedure is not run. Can you please let me know how to fix this.

    E:Program FilesMicrosoft SQL Server110ToolsBinnSQLCMD.EXE -E -S %DBSERVER% -d %DATABASE% -Q “SET NOCOUNT ON; exec my_stored_proc” -o %NOUTQ%Reportsmy_stored_proc_report.txt -s” ” -W -k1 -u

  • Dharanitharan

    Hi, Is it possible to schedule the batch file to run multiple times on a single day? If yes, can you please provide me the steps to schedule it multiple times on a single day.

    Thanks in advance!

  • abc

    It helped me alot..! thanx

  • Frank Van Der Mast

    not sure if still relevant but here is an example of a backup task put into a .BAT file:


    (D is the source location for the original files and E is the destination location)
    This command will copy all files from D:DATA to E:BACKUPS preserving (sub)folder structure and it will only copy&replace modified files.. so it won’t copy over if files haven’t been changed since last backup.

  • Recent Comments