Hi Monks,
I am looking for some advice/idea on a problem I am facing with the Net::SSH2 Module.
I work in a windows environment with CYGWIN. I succesfully use Net::SFTP::Foreign with Net:SSH2 as a back-end to send and get files my programs need.
I now want my main (father) script to be able to start remote (sons) perl scripts on multiple servers.
I use a batch file to start my perl script. The batch file works fine and starts my perl script the way I want it to when I execute it through RDP. The script runs in a console window.
Here is the code I use to try to start my program :
my $ssh = Net::SSH2->new(); $ssh->connect($IP,$port) or die "Unable to connect $@ \n"; if ($ssh->auth_password($user, $password)) { my $chan = $ssh2->channel(); $chan->exec("c:/foo/bar/myScript.bat \n"); $chan->close; }
The strange thing is it works fine with various apps I tested it with (eg Calc.exe, Notepad.exe, the Padre IDE...) but I can't get it to start and display cmd.exe or batch file execution window. All I see on the server side is a conhost.exe process spawning for a second.
I'm assuming the problem might be not on the perl side as I have it working with some apps. But I thought it wouldn't be dumber to ask for the help of the wise than to stay alone and scared in the darkness of ignorance.
Thank you in advance for anything that could put me in the right direction.
Porax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |