Run windows application using config file, instead of shortcuts.
-
Create a shortcut in windows is good, but when you move your application folder, the shortcut becomes broken
-
When run some applications like batch file, you don't want a black "cmd.exe" window to appear
.NET runtime, any version should work. If you found a problem, please post a issue.
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
-
Read the first arg passed into
runapp.exe. If run"runapp.exe example.arg", then"example.arg"file will be used. -
Find the same base file name as
runapp.exefile itself, but end with.arg. If the exe file isabc.exethenabc.argfile will be used only if it exists. -
Finally,
config.argin same dir will be used.
-
Any empty lines will be ignored.
-
//started is a comment line
config.arg
// this is comment line
chrome.exe
: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.
run application window style
Can be: normal, hidden, minimized, maximized (or any first letters matches)
Default: normal
set WorkingDir for the application
Can be: Absolute path, or relative path
Default: runapp folder
decide whether useShellExec
Can be: true, false
Default: true
decide whether createWindow
Can be: true, false
Default: true