Command No Window Utility
v.1.0.0.0
Copyright (c) 2017 by dennisbabkin.com. All rights reserved.
(Windows XP/Vista/7/8/8.1/10)

LAST MODIFIED: 1/28/2017


DESCRIPTION:
================
Utility that allows to run command line programs and scripts without displaying the command line, or console window. (This utility by itself will not display any UI if it was run with command line arguments.) Such can be helpful when running commands on schedule without distracting the work of a logged in user at the time when the schedule is triggered to run.

If receiving the output from running a command is required, make sure to enable Windows Event Logging via the VerboseLog registry value, described below.



Usage:

cmdNoWnd [CMD]

where CMD is one of:

  - Windows executable image name or path. You can specify such file using its full or relative path.
     Anything that follows it will be interpretted and passed to the executable file as its command
     line arguments.

     Example:
      To renew a DHCP-assigned IP address configuration for only the Local Area Connection adapter:

       cmdNoWnd ipconfig /renew "Local Area Connection"

  - DOS batch file with .bat or .cmd file extensions.
     Anything that follows it will be interpretted and passed to the batch script as its command
     line arguments.

     Example:
      To run a custom batch script from the cmds.bat file:

       cmdNoWnd "path-to\cmds.bat"

  - PowerShell script file with .ps1 file extension.
     Anything that follows it will be interpretted and passed to the PowerShell script as its command
     line arguments.

     Example:
      To run a custom PowerShell script from the PSscript.ps1 file and pass it a special parameter v=2:

       cmdNoWnd "path-to\PSscript.ps1" v=2




INFO: Additionally you can use the following registry key:

HKLM\SOFTWARE\www.dennisbabkin.com\cmdNoWnd\Settings

with the following values to specify special settings for cmdNoWnd utility:

 VerboseLog
   Type: DWORD	= specifies type of logging into Windows Event Log to be done during cmdNoWnd operation.
                  Use one of the following values:

                   0 = (default) not to do any logging (only errors will be logged)
                   1 = to do minimal logging, i.e. a single entry per call (errors will be always logged)
                   2 = for full verbose logging. Use this mode to diagnose issues.

                  INFO: Each logged message will contain the following:
                         - UTC date & time when logged.
                         - Version of the cmdNoWnd app.
                         - OS error code during the logging (enclosed in parentheses.)
                         - UniqID that is unique for each call to cmdNoWnd.
                         - Message specific for each logging event. In case of a verbose logging,
                            cmdNoWnd will also capture the output from running your command.
                            Note that such output is limited to roughly 32K characters.

 PsExecBypass
   Type: DWORD	= used only for running PowerShell scripts.
                  Use one of the following values:

                   0 = to use execution bypass currently set in the system.
                   1 = (default) to enable execution bypass.




Exit Codes:
 1      if showed help window. (Such happens if cmdNoWnd is called without any command line arguments.)
 -1     if failed to run provided command (check Windows Event Log for details.)
 Other  exit code from running provided process/command (values are specific to the process or command itself)







To download your copy go to:
https://www.dennisbabkin.com/cmdNoWnd

For bug reports go to:
https://www.dennisbabkin.com/sfb/?what=bug&name=cmdNoWnd


Thank you!










