Here is the command I try to execute:
runas /netonly /user:DOMAIN\user "cmd /k C:\Program Files (x86)\program.exe" When i try to execute it I have the following error message:
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
As the following commands work:
runas /netonly /user:DOMAIN\user "C:\Program Files (x86)\program.exe" cmd /k """C:\Program Files (x86)\program.exe""" I also try this command:
runas /netonly /user:DOMAIN\user "cmd /k """"""C:\Program Files (x86)\program.exe""""""" # bad syntax runas /netonly /user:DOMAIN\user "cmd /k \"C:\Program Files (x86)\program.exe\"" # The term 'x86' is not recognized I didn't manage to find the right used of double quotes to make my command run.
1 Answer
One way is to use the short pathname, e.g.
runas /netonly /user:DOMAIN\user "cmd /k C:\Progra~2\program.exe" dir /x will give both the short and the long filename.