Minimize CMD window When Using Psexec in Action Script

I am using the following command in action script to allow the user to interact with an install. It works well, but the one problem I have is that the CMD window is open on the desktop, and users will sometimes close it which can cause the action to not complete successfully. Does anyone know of parameter that will minimize the CMD window when the action is run?

waithidden “{parameter “baseFolder”}PsExec.exe” -accepteula -s -i {if (major version of operating system < 6) then 0 else session id of logged on user} -w “{parameter “installdir”}” cmd.exe /c run.bat

Hey Mike,

I’m leaving out the actionscript in my test, since this is really a cmd.exe issue. Psexec doesn’t seem to have any support for this, but the built in start command does.

If I run psexec -s -i cmd.exe /c start /min C:\Temp\test.bat it does technically do what you want, but it has a nasty side effect. The command window is minimized, but after it completes it leaves the command window there for anyone to have fun with. It appears that the start command may use cmd.exe /k behind the scenes when executing batch files.

I did find a SuperUser thread that may have some solutions you could use, depending on your environment.