Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Net::SSH2 some programs launch but can't get my script to run

by syphilis (Archbishop)
on Oct 21, 2014 at 08:43 UTC ( [id://1104537]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Net::SSH2 some programs launch but can't get my script to run
in thread Net::SSH2 some programs launch but can't get my script to run

You're not really doing anything to create a cmd.exe console and keep it alive.
C:\sisyphusion>type script.pl use warnings; print "Hello World\n"; C:\sisyphusion>type try.bat @echo off set PATH=C:\MinGW\perl516\bin;C:\MinGW\bin;%PATH% @echo on cmd /k perl script.pl C:\sisyphusion>
When I double click on 'try.bat' I get a cmd.exe console pop up that contains:
C:\sisyphusion>cmd /k perl script.pl Hello World C:\sisyphusion>
I think you should be able to make use of that approach, too.
It's the "/k" switch that keeps the cmd.exe console alive. If you use "/c" instead, then the cmd.exe console closes as soon as the perl script has finished executing.
(The "@echo off" and "@echo on" merely conceal the output of the "set PATH" command - you probably already know that.)

Cheers,
Rob

Replies are listed 'Best First'.
Re^4: Net::SSH2 some programs launch but can't get my script to run
by Porax (Acolyte) on Oct 21, 2014 at 09:23 UTC

    Tried the "/k" but it sadly didn't change a thing.

    The batch is working fine when I start it with a double click, also I don't really need to care about keeping the console alive as the script is an infinite loop processing files continuously provided by another app.

    At the moment the batch started through SSH is actually executed and keeps running (stays in the task manager), the only problem left is for it to display properly on the Desktop.

    After my last tries I think the problem might be with cygwin. I have a c:\Cygpath\bash.exe process running that may be encapsulating my actual command and prenventing its display. I will have a look in this direction.

    Thanks for the suggestions !

    Still up for more ideas !

    Porax

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1104537]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-19 06:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found