Skip to content

Run windows application using config file, instead of shortcuts

License

Notifications You must be signed in to change notification settings

futurist/runapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RunApp windows

Run windows application using config file, instead of shortcuts.

Why

  1. Create a shortcut in windows is good, but when you move your application folder, the shortcut becomes broken

  2. When run some applications like batch file, you don't want a black "cmd.exe" window to appear

Requirement

.NET runtime, any version should work. If you found a problem, please post a issue.

Usage

The executable "runapp.exe" read all configs from file "config.arg", the file content like below:

config.arg

chrome.exe
--disable-infobars
--user-data-dir=c:\chrome
--disable-plugins
--disable-plugins-discovery
--disable-translate
--start-maximized
--disable-dev-tools
--profile-directory=Default
https://www.google.com

The config is simple, the first line is the program to launch, rest lines are arguments passed to it.

Put the "runapp.exe" with same folder as "config.arg", then run it.

The arg file search algorithm

  1. Read the first arg passed into runapp.exe. If run "runapp.exe example.arg", then "example.arg" file will be used.

  2. Find the same base file name as runapp.exe file itself, but end with .arg. If the exe file is abc.exe then abc.arg file will be used only if it exists.

  3. Finally, config.arg in same dir will be used.

Advanced Usage

  1. Any empty lines will be ignored.

  2. // started is a comment line

config.arg

// this is comment line
chrome.exe
  1. : started is a meta command

config.arg

// below will run batch file in hidden window
:style: hidden
// below set WorkingDir for the application
:dir: c:/windows

abc.bat
arg1
arg2

Thus can run a hidden dos batch silently.

All meta commands

:style: normal

run application window style

Can be: normal, hidden, minimized, maximized (or any first letters matches)

Default: normal

:dir: .

set WorkingDir for the application

Can be: Absolute path, or relative path

Default: runapp folder

:shell: true

decide whether useShellExec

Can be: true, false

Default: true

:window: false

decide whether createWindow

Can be: true, false

Default: true