![]() |
Command line utilitiesFolder: CMD-Utilities |
![]() |
![]() |
SergCODE source code package (Freeware) |
All the utilities (batch files of the following pattern: $utilname.cmd), when run in the help mode (?, /?, or -?), print usage info. This info can also be seen by running the corresponding batch file (without parameters) from Windows Explorer. This holds for all the commands excluding $sysshutdown.cmd, $sysrestart.cmd, $syshibernate.cmd, and $syslogoff.cmd that do not require parameters.
If you want to use a command successfully, you should study (at least, quickly, without getting into details) the contents of the corresponding batch file. All the utilities (as well as most of the auxiliary CMD-files of the package) support the so called “direct call mode” and “nested call mode”. The mode choice influences such behavior as: output clearing before running, command confirmation, sound signal on error, final pause. (See design of the command files of the utilities and samples.)
Before running utilities, you must set a path to the CMD-Utilities folder by using the PATH environment variable. It is also recommended to globally set some of the main $-variables of the utilities (enumerated in the description of the $UtilVars command on this page).
Command | Short description | Based on | Purpose (see the detailed info in the call syntax) | Used required environment variables and files | Used non-required environment variables and files |
$SqlTrans | Translator of SQL script files | SQLCMD |
Translation of SQL script files, as well as command and query execution (obtaining a plain text report). Scripts (for example, stored procedures) may be translated individually or in groups using a file name pattern (for example: $SqlTrans "*.sql"). This kind of actions should be put in auxiliary batch files (“action_name.cmd”). For conveniency, this utility may be “integrated” into Windows Explorer, the EmEditor editor, the Far Manager file manager, and other applications. See this page: SQL Tools (section SQL, contains detailed explanations). The most interesting example of $SqlTrans usage is organization of the so called SQL-project based on script files, for all the database objects: stored procedures, functions, views, tables, etc. (The package contains the corresponding examples.)
See programming samples (the SQL\Programming Samples folder). ATTENTION!!! You may run only ONE instance of the $SqlTrans utility at a given point in time. This inconveniency is due to the fact that the SQLCMD command processes a temporary $sql_script.sql file in the TEMP folder instead of source SQL files. (Running two or more translations in parallel will cause their “intersection.”) |
$sql_server, $sql_database $oem_cp, TEMP $sql_settings.sql |
$sql_settings_script $sql_script_cp, $sql_report_cp $sqltrans.AdditionalParams $sqltrans.SkipConfirmation$sqltrans.SkipCompletionPause $sqltrans.ShowConnectionInfo |
$SqlUpload | Loading data from text files | BCP, $SqlTrans |
You may use this utility to “load” one text file or more into indicated database tables. SQL prescript and postscript execution is also supported. ATTENTION!!! Since BCP errors are not always caught, you should visually check the text output of this command.
See programming samples (the SQL\Programming Samples folder). |
$sql_server, $sql_database as well as all the required variables and files for $SqlTrans (if activated) |
$sql_uploading_cp, $sql_uploading_colsep $pre_upload.sql, $post_upload.sql as well as all the non-required variables and files for $SqlTrans (if activated) |
$Sql | Simple interactive, command-line SQL | SQLCMD | This command invokes the SQLCMD interactive mode decorated by auxiliary text information. (Designed for calling from the command line directly.) |
$sql_server, $sql_database |
|
Command | Short description | Based on | Purpose (see the detailed info in the call syntax) | Used required environment variables and files | Used non-required environment variables and files |
$WdkBuild | Calling the WDK project compiler | BUILD, SETENV |
You may use this utility for a good support of the WDK project compiler commands that are activated by a set of auxiliary command batches. (See examples from the DriverPrograms section.) |
$wdk_root |
|
Command | Short description | Based on | Purpose (see the detailed info in the call syntax) | Used required environment variables and files | Used non-required environment variables and files |
$XAppDistr | Utility for automated application folder copying from application ditribution to application server cashes | XCOPY, TASKKILL, OPENFILES |
You may use this command for creating a simple LAN distribution of applications that may be installed by the XCOPY method. By default, application folders are force-copied to servers (in parallel). Actions supported: distrite, update, and delete. (See examples of the XCOPY usage in the Miscellaneous (Demo)\CMD\XCopy Application Distribution folder.) While solving the network installation problem to a certain degree, this utility leave the network start problem unsolved. In certain cases, for centralized management of application start, you may use universally accessible network folder shortcuts with relative paths (based on environment variables). However, the real solution is a server starter that (1) provides users with the shortcut tree analogy and (2) is able to execute preliminary application cashing (file update from a network resource) on a local disk before starting from it. |
|
$xappdistr.TaskKillExeName, $xappdistr.OpenFilesSubstring $xappdistr.PostUploadScriptFile $xappdistr.PostUploadScriptErrorAffectsFailedServersList $xappdistr.AskConfirmation |
$MAppDistr | Utility for automated multiple distributions of application sequences from distributions to server cashes | $XAppDistr |
This command is designed for processing all the aplication distribution folders (having the .Distr extension by default) by the $XAppDistr utility in the current distribution catalog. In every subcatalog, the auxiliary batch corresponding to the action is run. (See the XCopy Application Distribution example.) |
|
$mappdistr.IgnoreAbsentScripts |
Command | Short description | Based on | Purpose (see the detailed info in the call syntax) | Used required environment variables and files | Used non-required environment variables and files |
$KeyGen | Generation of a private/public key cryptographic pair | SN |
This command generates a new cryptographic pair, by making several calls to to the SN .NET-utility, and extracts info about the received public key in every form supported by SN. (If the current folder already contains cryptographic files, the call is rejected.) |
|
|
$CspInstall | Installation of a cryptographic pair in a CSP container | SN |
This command installs a cryptographic pair in an indicated (by name) container of the cryptographic subsystem from an indicated file (CSV, PFX, etc.). |
|
|
$CspUninstall | Uninstallation of a cryptographic pair from a CSP-container | SN |
This command removes an indicated (by name) CSP container from the cryptographic system. |
|
|
Command | Short description | Based on | Purpose (see the detailed info in the call syntax) | Used required environment variables and files | Used non-required environment variables and files |
$NDrvMap | Mounting a network drive | NET USE |
This simple utility mounts a network drive and gives a confirmation message. (This command is designed to be wrapped by an auxiliary batch and creating a shotcut to that batch for conveniency.) |
|
|
$NDrvUnmap | Unmounting network drive | NET USE |
This simple utility unmounts a network drive and gives a confirmation message. This simple utility mounts a network drive and gives a confirmation message. |
|
|
Command | Short description | Based on | Purpose (see the detailed info in the call syntax) | Used required environment variables and files | Used non-required environment variables and files |
$EnVars | Output of all the environment variables | SET |
This simple utility outputs a list of all the environment variables. The SergCODE tool panel contains a link to this command (the Utilities\Shortcuts\Toolbar folder). |
|
|
$PathVars | Output of path variables | SET |
This simple utility outputs values of the PATH и PATHEXT environment variables. The SergCODE tool panel contains a link to this command (the Utilities\Shortcuts\Toolbar folder). |
|
|
$UtilVars | Output of the main utility variables (the SergCODE package) | SET |
This utility outputs valies of the following environment variables: $ansi_cp, $oem_cp $sql_server, $sql_database $sql_script_cp, $sql_report_cp, $sql_uploading_cp, $sql_uploading_colsep $sql_settings_script, $sql_additional_params $wdk_root TEMP SergCODE_Root Some of these variables are those ones that you should set in the system (default names). The SergCODE_Root variable value should contain a path to the SergCODE folder (without the backslash at the end). The SergCODE tool panel contains a link to this command (the Utilities\Shortcuts\Toolbar folder). |
|
|
Command | Short description | Based on | Purpose (see the detailed info in the call syntax) | Used required environment variables and files | Used non-required environment variables and files |
$NewCon | Starts a new console of the CMD command interpreter | CMD |
This utility is designed for starting a new command-line console (maximized). The started CMD session sets its $cmd_plain variable to 1. (All the ulitity batches in this kind of environment ignore the output clearing before running and final pause.) The SergCODE tool panel contains a link to this command (the Utilities\Shortcuts\Toolbar folder). |
|
|
Command | Short description | Based on | Purpose (see the detailed info in the call syntax) | Used required environment variables and files | Used non-required environment variables and files |
$SysShutdown | Shuting down the system | SHUTDOWN |
This simple utility is designed for initiating system shut down, including a warning message. It is possible to make a forced shutdown (forced mode). The SergCODE tool panel contains a link to this command (the Utilities\Shortcuts\Toolbar folder). |
|
|
$SysRestart | Restarting the system | SHUTDOWN |
This simple utility is designed to initiate system restart, including a warning message. It is possible to make a forced restart (forced mode). The SergCODE tool panel contains a link to this command (the Utilities\Shortcuts\Toolbar folder). |
|
|
$SysHibernate |
Hibernating the system (RAM swapping to disk) — available from Windows Vista on |
SHUTDOWN |
This simple utility is designed to initiate system hibernation, including a warning message. It is possible to make a forced hibernation (forced mode). The SergCODE tool panel contains a link to this command (the Utilities\Shortcuts\Toolbar folder). |
|
|
$SysLogoff | Logging off from the current user profile | SHUTDOWN |
This simple utility is designed to initiate logging off from the current user profile, including a warning message. It is possible to make a forced logoff (forced mode). The SergCODE tool panel contains a link to this command (the Utilities\Shortcuts\Toolbar folder). |
|
|
Top |
© Sergei Kitaev (Китаев С.Ю.) |