Launching an .exe

From: lmm (no email)
Date: 02/10/04


Date: Tue, 10 Feb 2004 14:42:02 -0500

I have written a script that that is supposed write a host file, open
a Windows executable file, sends out a few pings and then runs a batch
file that maps drives.

The problem I am having is that the the script stops after the
executable is launched. Presumably because it does not close and
therefore the script "hangs." The .exe is a VPN client so it cannot
run last. When I decided to add the pings and the batch file the
script stopped working, of course now I realize it was never working
as expected.

I have tried the following code to launch the exe:

my $exe = '"C:/Program Files/SonicWALL/SonicWALL Global VPN
Client/SWGVpnClient.exe"' ;
exec $exe ;

I also tried putting the above in a separate script and then a batch
file and having the script launch that and finally what is written
below. So I guess I need a way to launch the exe and then have the
Perl script move forward.

if ($loc eq "n") {
     print "Writing the non-VPN hosts file.\n" ;
     print HOSTS $not ; #write the file
     print "Wrote non-VPN hosts file.\nYou may close this window by
typing exit or clicking the X\n" ;
     } else {
     print "Writing the VPN hosts file.\n" ;
     print HOSTS $vpn ; #write the file
     
     #opens the VPN Client software
     
     print `C:/Program Files/SonicWALL/SonicWALL Global VPN
Client/SWGVpnClient.exe` ;
     print `ping -n 10 gwdc` ;
     print `C:/VPN/BAT//WIN2KLOGONFDQN.BAT` ;
     print "Wrote VPN hosts file and executed LOGON script.\nYou may
close this window by clicking the X\n" ;

}



Relevant Pages

  • Re: convert VB script code to vb (cheap & dirty)
    ... an exe, there are other "cheap-and-dirty" ways to do it. ... of the compiler, the runtime, your script and a little ... the compiler, the runtime and your source code into temporary ... running your vbs with wscript). ...
    (microsoft.public.scripting.vbscript)
  • Re: exe file
    ... "Train my users"? ... An EXE, ... than a VBS script at doing just about anything. ... to convey the general difference between compiled code ...
    (microsoft.public.scripting.vbscript)
  • Re: Cross Site Scripting for .exe?
    ... How can an exe take in these ... > number and no other info...How do i find out if my script has been ... The error message thrown probably, depending on method, does ... webserver input file input file from the DB checked for other keyword ...
    (alt.computer.security)
  • Re: Newbie Question HELP!
    ... >print because this only seems to run in python shell, or is there a way to ... Others have mentioned ways to get an EXE, but I am wondering if you are really ... go back to the "DOS"/console window (or start one and cd to the ... and you'll be able to re-run your script by just typing python myprog.py (or even just myprog.py ...
    (comp.lang.python)
  • Re: from vbs to exe
    ... a script into an EXE file. ... the self-executing zip will end up being an EXE ... You can't actually compile a VBS file. ... Script is text-based programming. ...
    (microsoft.public.scripting.vbscript)