So I found this Stack Overflow question which relates to what I would like to do; however, I am having trouble with the directory having spaces within it. I tried looking at several other Stack Overflow questions, but either I misunderstood them, or none have really addressed my problem. I've seen stuff on passing arguments as arrays and using %1
or something to address the special characters, but nothing has worked yet.
I tried entering the following into cmd.exe:
schtasks /Create /SC DAILY /TN PythonTask /TR "python "C:\Users\me\stuff with spaces \pythonprogram.py""
However, the quotes appear to not be taken in the correct order. I would like the command to be input as python "C:\Users\me\stuff with spaces \pythonprogram.py"
to cmd.exe everyday.
How can I use quotes around quotes on the Windows command line?
ANSWER FROM BELOW:
Add a backslash \
before the argument which you are putting in quotes. I.e.:
do_some_command_in_windows_shell_with_this_given_string "run "something.exe""
is replaced with:
do_some_command_in_windows_shell_with_this_given_string "run \"something.exe""