By Achilles Hill | Last Updated
Have you ever been in this situation? Created a batch file, created a basic task in the Task Scheduler and wanted to automatically delete the contents of the temporary folder when the PC starts up. But when the PC starts up, nothing happens. In this post, I will share you the most effective ways to fix Windows 10/11 task scheduler batch file not executing issue.
Step 1: Ensure that the account you use to run the script in Task Scheduler has full control over the folder containing the script, the script itself, and any folders/files touched by the script when it runs.
For instance, I created the following batch file.
net stop "SQL Server Reporting Services (MSSQLSERVER)" timeout /t 10 net start "SQL Server Reporting Services (MSSQLSERVER)"
Step 2: Save the .BAT file in my Documents folder. The path is C:\Users\username\Documents. Go back to C:\Users\username, right-click on the Documents folder and clicked on Properties.
Step 3: Move to the Security tab, the user account Angelia has been added and given full control permissions. Now repeat the above steps for the folder containing the script and for the script itself. Don't assume that giving permissions to the folder containing the script is sufficient. Finally, set permissions on any files and folders that the script will interact with.
Step 1: Type Task Scheduler in the Start menu bar and click Open.
Step 2: Select Properties under the Action tab.
Step 3: Move to the Actions tab and click on the New option below.
Step 4: Under Program/script, type: C:WindowsSystem32cmd.exe. Then type /c start "" "C:location_to_batch_fileyour_batch_file.fs" in the Add arguments (optional). Finally click OK to finish the settings.
In the Task Scheduler, double-click a batch file task to open, under the General tab, select Run with highest privileges and click OK to apply the settings.
Step 1: Use Windows + I to open Settings, find and click Update & Security.
Step 2: Under the Windows Update, click Check for updates. If there are any Windows updates available, please upgrade to the latest version.
Related Articles: