psexec仅在使用用户名和密码并从PowerShell脚本调用时挂起
我正在尝试使用psexec在已打开的交互式会话中启动进程。 我的机器和远程机器都是Windows 7.使用命令提示符内的命令可以正常工作,可执行文件已启动,并在GUI中可见。 psexec64 -accepteula -nobanner \\hostname -u domain\user -p password -h -i 2 -d C:\workingdir\subfolder\application.exe 但是,当我尝试在PowerShell脚本中执行相同的调用时,它不起作用。 查看完整脚本的上下文。 # invalid args: $psExecArgs = "-accepteula", "-nobanner", "-u domain`\${username}", "-p ${password}", "-h", "-i ${sessionId}", "-d", "`\`\${hostname}", "`"${executableDirectory}`\${executableName}`"" # hangs: $psExecArgs = "-accepteula", "-nobanner", "-u domain`\${username}", "-p ${password}", "-h", "-d", "`\`\${hostname}", "`"${executableDirectory}`\${executableName}`"" $psExecArgs = "-accepteula", "-nobanner", "-h", "-d", […]