run

Package: WA2L/WinTools 1.2.08
Section: General Commands (1)
Updated: 28 January 2024
Index Return to Main Contents

 

NAME

run - start application-executable using an application name

 

SYNOPSIS

WA2LWinTools/(bin|lib)/run [ -h | -V ]

run [ -w ] application [ options ]

run [ -p ] application

run [ -e ] application

run -l [ selection ]

run -i application [ options ]
run -u application

 

AVAILABILITY

WA2L/WinTools

 

DESCRIPTION

This command is similar to the appstart(1) command to start applications, but allows to start the applications more conveniently thru a short call: run application from within a start menu, a hotkey manager, from the users 'Desktop' or thru the command line interface.

When changing base installation directories, the SEARCHPATH in the etc/appstart.cfg file can be changed.

When changing application installation directories (versions etc.) only the mapping in the etc/run.cfg file must be changed and the applications can be started from all start possibilities without change.

 

OPTIONS

-h
usage message.

-V
print program version.

-i
create an application start shortcut on the users 'Desktop'.

Whenever an icon with the same name as the application exists in the var/icons/ or lib/icons/ directory, the desktop shortcut is created with that icon.

If there are no icons in the mentioned directories, run tries to extract the icon from the executable related to the specified application. The extracted icon is saved in var/icons/. If you don't like the extracted icon it must be replaced manually.

If it is also not possible to extract an icon the >> icon of the run command will be shown on the created 'Desktop' shortcut.

-u
remove the application start shortcut from the users 'Desktop'.

-p
print search matches and parameters for a given application without starting the target program.

-e
print first existing search match executable (START-EXECUTABLE) for a given application without starting the target program.

-l
list all applications defined in the etc/run.cfg file.

-w
set the working directory to the current directory. Default is to set the working directory to the directory of the resolved executable.

selection
regular expression to only list selected applications when using the -l option.

application
application name. The application name is not case sensitive.

options
optional additional options for the application. This options are appended to the OPTIONS defined in the configuration file etc/run.cfg.

 

ENVIRONMENT

The following environment variables are added to the environment by the run command and are therefore available within the started commands:

%WA2L_START_FROM_TTY%
this variable is set to True when the run command was started from a command window (aka. tty), when started thru a double click directly or via 'Send To' menu the variable is set to False.

This environment variable then can be used in started *.cmd or *.bat files to react accordingly based on the start situation.

%WA2L_INSTALLDIR%
installation base directory of the WA2L/WinTools package.

%PATH%
the %PATH% environment variable is prepended by the setting of PATH_PRE=setting in etc/appstart.cfg.

 

EXIT STATUS

0
no error.

4
usage message displayed.

1
error.

 

FILES

etc/run.hostname.cfg
etc/run.domainname.cfg
etc/run.cfg
configuration file(s) for run.

The configuration file(s) are read in the sequence: run.hostname.cfg -> run.domainname.cfg -> run.cfg when existing. The hostname is replaced by the %COMPUTERNAME% and domainname is replaced by the %USERDOMAIN% environment variable.

The configuration file is a CSV file of the format:

  #
  # run.cfg - configuration file for run.exe 
  #
  # [00] 20.07.2018 CWa Initial Version
  #
  APPLICATION;EXECUTABLE;OPTIONS;
  Excel;Microsoft Office\Office14\excel.exe;;
  Excel;Microsoft Office\Office16\excel.exe;;
  GIMP;GIMPPortable\GIMPPortable.exe;;
  Firefox,FF;FirefoxPortable\FirefoxPortable.exe;-private-window;
  XMind;XMindPortable\XMind 8 Update 1\XMind.exe;;
  Gnuplot;Octave\octave-4.2.1\bin\wgnuplot.exe;;
  Writer;OfficePortable\Writer.exe;;

See: run.cfg(4) for more information.

etc/appstart.cfg
optional configuration file of appstart(1) and run(1).

var/icons/
save own icons into that directory.

lib/icons/
icons distributed with WA2L/WinTools. Do not add/remove files in this directory, your changes might be lost after an upgrade of the WA2L/WinTools package.

The icons in var/icons/ have priority over this directory.

 

EXAMPLES

1) use run in the PStart portable start menu

To start the applications you can use the portable start menu pstart(1) which is bundled with WA2L/WinTools:

Excel (Microsoft™ Excel™ spreadsheet program):

  Application / file path: run.exe
  Command line parameters: Excel
  Advanced > Window state: minimized

GIMP (Gnu Image ManiPulator):

  Application / file path: run.exe
  Command line parameters: GIMP
  Advanced > Window state: minimized

Firefox (Start browser in private window):

  Application / file path: run.exe
  Command line parameters: Firefox
  Advanced > Window state: minimized

X-Mind (Mind mapping):

  Application / file path: run.exe
  Command line parameters: XMind
  Advanced > Window state: minimized

Gnuplot (Mathematical function plotting):

  Application / file path: run.exe
  Command line parameters: Gnuplot
  Advanced > Window state: minimized

WPS Writer (Portable word processor):

  Application / file path: run.exe
  Command line parameters: Writer
  Advanced > Window state: minimized

You might notice that you see the >> icon of run in PStart for the created entries in the menu. To change this you can set an icon for each command:

To use an icon (*.ico) file:

  Advanced > Replace icon: ..\var\icons\Writer.ico

To extract an *.ico file from an executable, the icongrabber(1) command can be used.

Own (extracted) icons should be saved to the var/icons/ directory and should have the same name as the chosen application name.

An other possibility to quickly get the icon saved to var/icons/ is to invoke on the console(1m):

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run -i Writer

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run -u Writer

2) use run in the HotkeyP portable hotkey manager

To start the applications you can use the portable hotkey manager hotkeyp(1) which is bundled with WA2L/WinTools:

Hint: The PStart start menu command also allows to define hotkeys.

Excel (Microsoft™ Excel™ spreadsheet program):

  Command:    run.exe
  Parameters: Excel
  Window:     minimized

GIMP (Gnu Image ManiPulator):

  Command:    run.exe
  Parameters: GIMP
  Window:     minimized

Firefox (Start browser in private window):

  Command:    run.exe
  Parameters: Firefox
  Window:     minimized

X-Mind (Mind mapping):

  Command:    run.exe
  Parameters: XMind
  Window:     minimized

Gnuplot (Mathematical function plotting):

  Command:    run.exe
  Parameters: Gnuplot
  Window:     minimized

WPS Writer (Portable word processor):

  Command:    run.exe
  Parameters: Writer
  Window:     minimized

3) use run thru shortcuts on the users 'Desktop'

To start the applications you can create shortcuts on the users 'Desktop':

1. Start the Console:

  Start Menu → WA2LWinTools → System → Console

2. Create the shortcuts using the following commands:

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run -i Excel

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run -i Gimp

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run -i Firefox

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run -i XMind

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run -i Gnuplot

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run -i Writer

4) use run to start the applications from the command line

To start the applications you can use the command line in the Console(1) or wtshell(1):

1. Start the Console:

  Start Menu → WA2LWinTools → System → Console

2. start the applications:

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run Excel

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run Gimp

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run Firefox

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run FF

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run XMind

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run Gnuplot

  [ h:\bin\WA2LWinTools\bin ]
  [ fred@ACME007 ][*wtshell*/cmd]: run Writer

 

SEE ALSO

wintoolsintro(1), appstart.cfg(4), hotkeyp(1), icongrabber(1), pstart(1), qsel(1), run.cfg(4), runpopup(1), softwarelist(1)

 

NOTES

-

 

BUGS

-

 

AUTHOR

run was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2020 Christian Walther

This is free software; see WA2LWinTools/man/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 16:32:53 GMT, September 14, 2024