这是我尝试执行的命令:
runas /netonly /user:DOMAIN\user "cmd /k C:\Program Files (x86)\program.exe"
当我尝试执行它时出现以下错误消息:
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
以下命令有效:
runas /netonly /user:DOMAIN\user "C:\Program Files (x86)\program.exe"
cmd /k """C:\Program Files (x86)\program.exe"""
我也尝试这个命令:
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
我没能找到正确使用双引号来使我的命令运行。
答案1
一种方法是使用短路径名,例如
runas /netonly /user:DOMAIN\user "cmd /k C:\Progra~2\program.exe"
dir /x
将给出短文件名和长文件名。