RUN.EXE + RUN.VBS


News

September 14, 2009: some time ago I received a patch from Steven Bartley to allow command line arguments, complete source code is here.

July 14, 2008: discovered similar tools here and also here.

January 4, 2007: the 'stop.exe' will remove the INI file automatically. The name of the 'stop.ini' file can be configured in 'run.ini'. Minor fixes in error messages.

December 24, 2006: improved 'run.exe' so it can write a file with the PID of the started program. Also created 'stop.exe' which can cleanup the processtree started by 'run.exe'. See the FAQ for an explanation on the usage.

February 16, 2006: adapted the 'run.c' file so it will execute scripts which realize a GUI using a DLL. Also uploaded a new executable.


Introduction

This is the homepage of a wrapper called 'RUN'. With this wrapper you can start a shell script or DOS executable without actually popping up the DOS box in which the script or executable runs.

Windows shellscripts are created using programming languages like Scriptbasic, Yabasic or newLISP. It is extremely usefull to use the 'RUN' wrapper in combination with the GTK-server. If a script designs a GUI using the GTK-server, the DOS box annoyingly will popup next to the GUI. With 'RUN' this problem can be solved.

The 'RUN' wrapper will run on all windows platforms. The 'RUN.VBS' script has the same function and purpose as the 'RUN.EXE' binary but is less powerfull.


Usage of 'RUN.EXE':
  1. Download 'run.exe' and 'run.ini' from this site.
  2. Put these files in the same directory as the script you want to run.
  3. You can rename the 'run.exe' to the name of your script. So, suppose your script program is called 'TEST.BLA', rename the 'run.exe' file to 'TEST.EXE'.
  4. If you start 'TEST.EXE' it will automatically search for an .INI file with the same name. In this case, it will search for a file called 'TEST.INI'.
  5. In the 'TEST.INI' file, put the command line you normally use to start the program, e.g. 'someinterpreter test.bla'.
Now, if you double-click the 'TEST.EXE' file from the Windows Explorer, the script is executed without a console window.

Usage of 'RUN.VBS':
  1. Download the 'run.vbs' script from this site.
  2. Adjust the constants MYSCRIPT and MYEXEC in this script to the strings you want to execute.
  3. Make sure the VB script is in the same directory as your GUI script.
  4. Start your GUI script by double-clicking the VB script.
Make sure you have installed the latest VB Script interpreter from Microsoft®. It can be downloaded for free from this location at section "Script Downloads".


FAQ

Question: Can I use your wrapper to run other types of console-based programs?
Answer: Yes, you can. Of course you will see no output since the console is gone.

Question: How do I stop a console-based program started with your wrapper?
Answer: There are three possibilities.
  1. Put the option CREATE_STOP_INI in the 'RUN.INI' configfile to YES. From then on the PID of executables started with 'run.exe' will be written to a new file. The name of this file also can be defined in 'RUN.INI'. By default the name is 'STOP.INI'. Executing 'stop.exe' will search for a file called 'STOP.INI' and read it's contents, after which the started processtree will be terminated.

    If the name of the STOP ini-file is defined differently, for example 'QUIT.INI', then also rename the STOP binary to 'quit.exe'. You can use any name you want for both the RUN binary and also the STOP binary, as long as the accompanying INI files start with the same name.

  2. In case of 100% console-based programs, pop-up the taskmanager with <ctrl><alt><delete>, select 'Processes', select your program and click 'End Process'.

  3. In case of interpreted programs with the GTK-server, you can create an EXIT button in your application.
Question: Can I use an other icon in the 'RUN.EXE' wrapper than the standard Turtle icon?
Answer: Yes, but then you need to recompile the wrapper yourself. Download the sourcefiles of the wrapper from this site and download the GCC compiler from MinGW. Replace the 'RUN.ICO' file with your icon. If your icon has the same name, recompile. Otherwise also edit 'RUN.C', 'RUN.RC' and 'Makefile' to use the correct filename.

Question: What is the license of this nice piece of software? Can I use it commercially?
Answer: Yes, it is free as in 'FREE' and 'GRATIS', do whatever you like with it.



Download

Precompiled binaries created with MinGW: Sourcefiles: The Visual Basic Script version of the wrapper:
  • run.vbs
  • Text version of the same VB script to view online here.


This page was last updated at September 14, 2009.

Contact: peter AT gtk-server DOT org

Unique visitors since january 2, 2007: