PDA

View Full Version : Spaces in WshShell.Run (W2K)



shdowflare
07-08-2002, 08:56 PM
Hi gang,

I'm trying to run the following command from the command line in a WSH script:

trnsfrmr.exe -i -nologo -n1 -r4 -keMartSAProd=usera/pass "D:\Progra~1\Cognos\BI DEV\Models\prod_month_sales.v2.1.pyi"

This is all one command line, and I'm having trouble getting it parsed properly. I'm new to scripting... I want to be able to kick this executable, then use SendKeys to fill in two dialog fields (User/Pass), before moving on to execute that file.

Any help is appreciated.

Thanks,
Brian

darkness
07-09-2002, 02:46 PM
Spaces shouldn't be a issue but the quotes aroound the path to the file will be.

Apply the string to a variable and replace it with chr(34)

so it would look something like this:

mycommand = "trnsfrmr.exe -i -nologo -n1 -r4 -keMartSAProd=usera/pass " & chr(34) & "D:\Progra~1\Cognos\BI DEV\Models\prod_month_sales.v2.1.pyi" & chr(34)

This will set the string to look exactly like the one you listed.

Try this and Good Luck.

Michael McLaughlin/images/forums/icons/smile.gif
Systems Manager
Minnesota State University Mankato