Share this article
Improve this guide
How to Execute Files in The Task Scheduler That Have Spaces
Don’t hesitate to apply our quick procedure right away
3 min. read
Updated onOctober 4, 2023
updated onOctober 4, 2023
Share this article
Improve this guide
Read our disclosure page to find out how can you help Windows Report sustain the editorial teamRead more
Some utilizeTask Schedulerto set up scheduled tasks that open software and files. However, those scheduled tasks might not always work for users. That is often because the files the tasks need to open include spaces in their file titles.
Consequently, a scheduled task might not open the software or a file it’s supposed to. However, it’s relatively easy to fix scheduled tasks that don’t open files with spaces.
How can I fix scheduled tasks that include files with spaces?
1. Add quote marks to the file paths
2. Delete spaces from file titles
3. Add backslash and quote marks to file paths in the Command Prompt
Users who utilize theSchtasks.exeCommand Prompt utilityto schedule tasks need to include additional backslash () and quote (“) marks around the file path with spaces (excluding arguments or switches) within the command. For example, a file path with arguments in the schtasks /create command would look something like this:
“\”c:\foldername with spaces\file.bat\”arguments”
Instead of this:
“c:\foldername with spaces\file.bat arguments”
The example above encloses the first file path within “\ and \” character combinations. However, arguments is left outside the character combinations, but it is still enclosed within the quote marks. With those character combinations included around the path, the task will run at the time scheduled within the command. A full command might look like the one in the snapshot below.
So, users can add quotation marks to the file paths in the Edit Action window, remove spaces from file paths, or add character combinations around file paths that include spaces in Schtasks commands. Then, the scheduled tasks should work.
If you are facing theTask Scheduler failed to launch an actionissue, we suggest you check out this solution guide.
More about the topics:task scheduler
Matthew Adams
Windows Hardware Expert
Matthew is a freelancer who has produced a variety of articles on various topics related to technology. His main focus is the Windows OS and all the things surrounding it.
He is passionate about the tech world, always staying up-to-date with the latest and greatest. With an analytical view, he likes problem-solving, focusing on errors and their causes.
In his free time, he likes to read and write about history and tries to always develop new skills.
User forum
0 messages
Sort by:LatestOldestMost Votes
Comment*
Name*
Email*
Commenting as.Not you?
Save information for future comments
Comment
Δ
Matthew Adams
Windows Hardware Expert
He is passionate about everything surrounding Microsoft’s OS, focusing on troubleshooting guides & tips for everyday problems.