Link to home
Start Free TrialLog in
Avatar of BraveLad
BraveLad

asked on

Executing one Winbatch program with another using RunWait

I am using a Winbatch script to execute another Winbatch script using the RunWait() statement. When I pass the other Winbatch program a parameter with an embedded blank it doesn't work. The parameter is a path which allows embedded blanks in the level of Windows I am using, but not I guess in the parameter variable. RunWait takes its parameters in the form %LogPath% where LogPath is assigned a string value of the path. How do I get RunWait to take the path as a single unit instead of multiple parameters when there are embedded blanks in the path contained in the variable LogPath?
Avatar of AlexFM
AlexFM

Did you try "%LogPath%" ?
Avatar of BraveLad

ASKER

Yes. It didn't work and honestly I did not expect it to since, that would make the parameter a constant and not a variable I thought. I guess I was right.
SOLUTION
Avatar of jphillips247
jphillips247

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What is the syntax in Winbatch to do this?
If I assign a string value enclosed in quotes in Winbatch, it only puts in what is inside the quotes in the variable. How do I get the quotes in the string in Winbatch?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Jphillips247, thank you. That worked. It was the lack of literal quotes in the string that caused the difficulty. There is a StrCat() function that also worked as well as your suggestion. This is a technique available in several languages, alternate forms of quotation in the syntax. So if you have single quotes and double quotes as alternates, then to get the other in its literal way included anywhere in the string, just enclose the whole in the alternate quote character to the one you wish to appear literally.