Is there a way to pass parameters that have spaces in it. My problem is that I am trying to pass a file spec path to an executable to set up a variable within a macro, but it only sees the value upto the space. Below is an example of what I am trying to do:
c:\folder\macro.exe /PATH=c:\my documents\data\test.txt /VAR2=value2
Once macro.exe runs, the variable PATH is "c:\my" instead of "c:\my documents\data\test.txt". If there is no spaces in the variable value, there is no problems. Is there something I can put the string in so I can pull in the complete path? I have tried numerous things (quotes, etc) but nothing seems to handle the space.
Not sure if there is any built in solution here.
Thanks.
Spaces in Parameters being passed to EXE doesnt work
Moderators: JRL, Dorian (MJT support)
-
- Pro Scripter
- Posts: 51
- Joined: Tue Oct 03, 2006 4:22 pm
- Location: Akron, Ohio
- Contact:
Put double quotes around parameters which contain spaces
This is not just a Macro Scheduler problem, this occurs when passing parameters to almost any EXE on the command line. The solution is to put double quotes around the parameter which has spaces in it.
I compiled the following simple macro and tested that it works fine
MessageModal>PATH
MessageModal>VAR2
Change This:
I compiled the following simple macro and tested that it works fine
MessageModal>PATH
MessageModal>VAR2
Change This:
To This:c:\folder\macro.exe /PATH=c:\my documents\data\test.txt /VAR2=value2
c:\folder\macro.exe /PATH="c:\my documents\data\test.txt" /VAR2=value2