Running psexec with username / password switches + program parameters causes "The handle is invalid" error.
Posted on 2011-05-05
I have an application that I am launching with psexec via an ssh session that I log into on the remote machine. So, I am calling psexec on the remote machine itself. The remote machine--a Windows 7 box--hosts MobaSSH which is a free SSH server for Windows. The application I am launching has a GUI which must launch because I need to pass a script to the application. The application must completely load before the script is processed.
Once logged in to the remote machine via SSH, I can launch the application, in interactive mode, with the following incantation:
psexec -d -i 2 -u myusername -p mypassword myapp -m
The application launches fine, and it is usable. But I get the following error / output in my terminal window:
The handle is invalid.
Couldn't install PsExec service:
Starting myapp on mycomputer . . . on mycomputer. . .
myapp started on mycomputer with process ID 3900
So while I can launch the application fine, the problem is that I cannot pass the script to the application with its switch with this incantation
psexec -d -i 2 -u myusername -p mypasswrod myapp -m -r myscriptfile.jsx
I get the same error, and the script simply does not get read in by the application. I have verified that if I am on the console session at the remote machine, and I simply type the following in a cmd shell, the script executes just fine:
myapp -m -r myscriptfile.jsx
Does anybody know what the "The handle is invalid. Couldn't install PsExec service" error is? Is that what is causing my script not to execute when myapp launches?
If you have any tips, suggestions, ideas as to how to solve this problem, I would be grateful.
Thank you for your time and help!