using cmd's Start command to run exe. Works locally, but not remotely

孤人 提交于 2020-01-05 08:22:44

问题


Some background: We are trying to automate installation of an agent on servers. The automated workflow will check for servers that need this install. If so, the workflow copies the necessary install files as well as a .cmd batch file.

When calling this .cmd script locally, the install works fine. But when trying to call this script remotely from the workflow server, it hangs on a certain line in the batch. Snippet from the script se_install.cmd:

echo Installing SE 9.4 Agent
start "" /wait "Installcimextensions.exe" -i silent
echo Install completed

We are using psexec to remotely call the above-mentioned script, using admin-level account that we use to execute many other scripts for other processes. Here is what the workflow server will run:

c:\scripts\psexec.exe -accepteula \\targetserver -u domain\username -p password \\targetserver\c$\temp\se\se_install.cmd

When running this remotely, the last output I see is "Installing SE 9.4 Agent". After that, it seemingly hangs indefinitely. At the same time, I'm on the local server viewing the list of running processes, and installcimextensions.exe never shows up on this list like it should be. I couldn't find any sort of known issues with running the "start" command remotely, but I assume that it might be part of the problem. Or could it possibly be an issue with the way I have the quotes set up, or the "-i silent" flag? I also tried replacing this "start" line in the batch with a call to another batch file that contains this line, but no dice.

Any advice? Thanks.


回答1:


after the first echo write cd c:\temp\se\se_install.cmd the thing is that running locally your current working dir is in the folder that has the .exe, but when you run it remotely your current working dir is the default one and you have to change it for your .bat to work



来源:https://stackoverflow.com/questions/12645918/using-cmds-start-command-to-run-exe-works-locally-but-not-remotely

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!