這是我嘗試執行的命令:
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
將給出短文件名和長文件名。