in reply to Re: 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

Hi Rob !

Here is my batch file

Title "Title" set PATH=%PATH%;C:\perlPath\perl\bin\bin;C:\path C:\perlPath\Perl.exe C:\path\script.pl @Pause

My script is started (I can see the cmd an perl processes spawning) but remains undisplayed.

to start calc.exe for my tests I use :

start c:/windows/system32/calc.exe

It works and the calculator is normally displayed

Thank for any idea that could come to your mind :)

Porax

Replies are listed 'Best First'.
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
    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

      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