- Source:
The WSH (Windows Script Host) CLI that launches apps according to the schema defined in a JSON file.
Requires
Methods
(static) launchAppsUsingSchema(schema, taskNameopt, optionsopt) → {void}
- Source:
Backs up the directories.
Example
var apL = Wsh.AppLauncher; // Shorthand
var schema = {
description: 'Example Schema WshAppLauncher',
components: {
binDir: 'D:\\MyApps',
etcDir: 'D:\\MyConfs',
wmLeftPath: null,
wmRightPath: null
},
tasks: {
'main:Claunch': {
app: '${binDir}\\CLaunch\\ClAdmin.exe'
},
'main:AutoHotkey': {
app: '${binDir}\\AutoHotkey\\AutoHotkeyU64.exe',
args: ['${etcDir}\\MyHotKey.ahk'],
runsAdmin: true
},
'main:FreeCommander': {
app: '${binDir}\\FreeCommander\\FreeCommander.exe',
args: ['/N', '/ini=${etcDir}\\FreeCommander.ini'],
winStyle: 'nonActiveMin'
},
'main:mkTmpDir': {
app: 'mkdir',
args: ['R:\\tmp_#{yyyyMMdd}'],
shell: true
},
'dev:cmdAdmin': {
available: false,
app: 'C:\\Windows\\System32\\cmd.exe',
runsAdmin: true
},
'dev:Vim': {
app: '${binDir}\\Vim\\gvim.exe',
args: ['-N', '-u', '${etcDir}\\_vimrc', '-U', '${etcDir}\\_gvimrc']
},
'app:WinMerge': {
app: '${binDir}\\WinMerge\\WinMergePortable.exe',
args: ['${wmLeftPath}', '${wmRightPath}'],
winStyle: 'activeMax'
}
}
};
apL.launchAppsUsingSchema(schema, 'main:*', {
logger: 'info/console',
});
// Only process appLog:current. appLog:lastMonth is not processed because available is false.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
schema |
typeSchemaAppLauncher | ||||||||||||||||||||||
taskName |
string |
<optional> |
The task name to launch. |
||||||||||||||||||||
options |
object |
<optional> |
Optional parameters. Properties
|
Returns:
- Type
- void
(static) launchAppUsingLog(app, argsopt, optionsopt) → {void}
- Source:
Launches the app.
Example
var apL = Wsh.AppLauncher; // Shorthand
apL.launchAppUsingLog('C:\\Windows\\System32\\net.exe', ['use'], {
runsAdmin: true,
winStyle: 'nonActive',
logger: 'info/console' // See https://github.com/tuckn/WshLogger
});
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
app |
string | The executable file path or the command of CMD. |
||||||||||||||||||||||||||||||||||||
args |
Array.<string> |
<optional> |
The Array of arguments. |
|||||||||||||||||||||||||||||||||||
options |
object |
<optional> |
Optional parameters. Properties
|
Returns:
- Type
- void