Running CMD Commands
The SaveToDB add-in allows loading and refreshing data from XML, JSON, HTML, and CSV files.
You can use Windows Shell and CMD commands for loading, preparing, or checking such files.
For example:
ID | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | EVENT_NAME | HANDLER_SCHEMA | HANDLER_NAME | HANDLER_TYPE | HANDLER_CODE |
---|---|---|---|---|---|---|---|---|
dbo | files | ContextMenu | dbo | Open {FileName} | CMD | notepad.exe {FileName} |
Use the CMD handler type with commands in the HANDLER_CODE field in the following format:
<Command> [<Parameter1>[ <Parameter2>[ ...]]
The commands can use context values in the following format: {ParameterName=DefaultValue} or simply {ParameterName}
Command examples:
{FileName} notepad.exe {FileName} dir *.* cmd /c dir {Mask=*.*} cmd /k dir {Mask=*.*} sayhello.cmd {FirstName} mailto:{Email}&subject=Thanks for the connection&body=Hello {FirstName},%0A
The latest example shows how to launch a new email using the mailto: command.
The mailto: handlers are added to menus for non-empty recipients only.
Use the cmd /c mode to execute a command and close the window after the execution. Use the cmd /k mode to leave the window opened.
The add-in launches the commands in the active workbook directory if the workbook has been already saved.
Important! Run commands from trusted sources only! The SaveToDB add-in does not check commands.