vmrun runprograminguest cmd.exe escape spaced words

1.5k Views Asked by At

I'm failed to execute this below command with vmrun.exe

vmrun -T viserver -h ipaddress -u admin -p xxx -gu administrator -gp xxx runProgramInGuest "xxx" -activeWindow -interactive cmd.exe "/c net use z: \ipaddress\folder /user:deepak xxx"

It shows "Guest program exited with non-zero exit code: 1", It seems that spaced words are taken as parameters "eg.net use param1 param2",

Can anyone help me to run as single command ?

1

There are 1 best solutions below

0
On

I got the solution,

vmrun -T viserver -h ipaddress -u admin -p xxx -gu administrator -gp xxx runProgramInGuest "xxx" -activeWindow -interactive "c:\windows\system32\cmd.exe" ""/c net use z: "ipaddress\sharefolder" /user:deepak "xxx"""

Quotes solve the issue