Prndrvr.vbs

The Prndrvr.vbs command is used to add, delete and list the installed printer drivers. Equivalent to prncnfg.vbs command, the prndrvr.vbs command is also a Visual Basic script located in the %WINDIR%System32Printing_Admin_Scripts directory. The prpndrvr.vbs command is also used at the command prompt by typing; cscript followed by the full path to the Prndrvr.vbs file, or change directories to the appropriate folder.

  • If the information that you supply contains spaces, use quotation marks around the text (for example, “Computer Name”).

Syntax (view syntax formatting guide):

Cscript prndrvr {-a | -d | -l | -x | -?} [-m <model>] [-v {0|1|2|3}] [-e <environment>] [-s <ServerName>] [-u <UserName>] [-w <Password>] [-h <path>] [-i <inf file>]

Syntax Explanation

  • -a: Installs a driver.
  • -d: Deletes a driver.
  • -l: Lists all printer drivers installed on the server specified by the -s parameter. If you do not specify a server, Windows lists the printer drivers installed on the local computer.
  • -x: Deletes all printer drivers and additional printer drivers not in use by a logical printer on the server specified by the -s parameter. If you do not specify a server to remove from the list, Windows deletes all unused printer drivers on the local computer.
  • -m : Specifies (by name) the driver you want to install. Drivers are often named for the model of printer they support. See the printer documentation for more information.
  • -v {0 | 1 | 2 | 3}: Specifies the version of the driver you want to install. See the description of the “–e” parameter for information on which versions are available for which environment. If you do not specify a version, the version of the driver appropriate for the version of Windows running on the computer where you are installing the driver is installed.

Version 0 supports Windows 95, Windows 98, and Windows Millennium Edition.
Version 1 supports Windows NT 3.51.
Version 2 supports Windows NT 4.0.
Version 3 supports Windows Vista, Windows XP, Windows 2000, and the Windows Server 2003 operating systems. Note that this is the only printer driver version that Windows Vista supports.

  • -e : Specifies the environment for the driver you want to install. If you do not specify an environment, the environment of the computer where you are installing the driver is used. The supported environment parameters are:

“Windows NT x86”
“Windows x64”
“Windows IA64”

  • -s : Specifies the name of the remote computer that hosts the printer that you want to manage. If you do not specify a computer, the local computer is used.
  • -u -w : Specifies an account with permissions to connect to the computer that hosts the printer that you want to manage. All members of the target computer’s local Administrators group have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work.
  • -h: Specifies the path to the driver file. If you do not specify a path, the path to the location where Windows was installed is used.
  • -i : Specifies the complete path and file name for the driver you want to install. If you do not specify a file name, the script uses one of the inbox printer .inf files in the inf subdirectory of the Windows directory.

If the driver path is not specified, the script searches for driver files in the driver.cab file.

  • /?: Displays help at the command prompt.

Explanation with Examples

To list all drivers on the \PrintServer1 server:

cscript Prndrvr -l –s

To add a version 3 Windows x64 printer driver for the “Laser Printer Model 1” model of printer using the C:tempLaserPrinter1.inf driver information file for a driver stored in the C:temp folder:

cscript Prndrvr -a -m “Laser Printer Model 1” -v 3 -e “Windows x64” -i c:tempLaserPrinter1.inf -h c:temp

To delete a version 3 Windows NT x86 printer driver for “Laser Printer Model 1”:

cscript Prndrvr -a -m “Laser Printer Model 1” -v 3 -e “Windows NT x86”

Prncnfg.vbs

The Prncnfg.vbs command is used to configure and display information about a printer. The Prncnfg.vbs command is actually a Visual Basic script located in the %WINDIR%System32Printing_Admin_Scripts<language> directory. So in order to use this command correctly you must first type cscript followed by the full path to the Prncnfg.vbs file, or change directories to the appropriate folder. The Prncnfg.vbs command is a very usefull tool for managing and maintaining the printers attached to local and remote computers using VB scripts.

 

Syntax (view syntax formatting guide):

Cscript Prncnfg {-g | -t | -x | -?} [-S <ServerName>] [-P <PrinterName>] [-z <NewPrinterName>] [-u <UserName>] [-w <Password>] [-r <PortName>] [-l <Location>] [-h <ShareName>] [-m <Comment>] [-f <SeparatorFileName>] [-y <Datatype>] [-st <StartTime>] [-ut <UntilTime>] [-i <DefaultPriority>] [-o <Priority>] [<+|->shared] [<+|->direct] [<+|->hidden] [<+|->published] [<+|->rawonly] [<+|->queued] [<+|->enablebidi] [<+|->keepprintedjobs] [<+|->workoffline] [<+|->enabledevq] [<+|->docompletefirst]

Syntax Explanation

  • -g: Displays configuration information about a printer.
  • -t: Configures a printer.
  • -x: Renames a printer.
  • -S <ServerName>: Specifies the name of the remote computer that hosts the printer that you want to manage. If you do not specify a computer, the local computer is used.
  • -P <PrinterName>: Specifies the name of the printer that you want to manage. Required.
  • -z <NewPrinterName>: Specifies the new printer name. Requires the -x and -P parameters.
  • -u <UserName> -w <Password>: Specifies an account with permissions to connect to the computer that hosts the printer that you want to manage. All members of the target computer’s local Administrators group have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work.
  • -r <PortName>: Specifies the port where the printer is connected. If this is a parallel or a serial port, then use the ID of the port (for example, LPT1 or COM1). If this is a TCP/IP port, use the port name that was specified when the port was added.
  • -l <Location>: Specifies the printer location, such as “Copy Room.”
  • -h <ShareName>: Specifies the printer’s share name.
  • -m <Comment>: Specifies the printer’s comment string.
  • -f <SeparatorFileName>: Specifies a file that contains the text that appears on the separator page.
  • -y <DataType>: Specifies the data types that the printer can accept.
  • -st <StartTime>: Configures the printer for limited availability. Specifies the time of day the printer is available. If you send a document to a printer when it is unavailable, the document is held (spooled) until the printer becomes available. You must specify time as a 24-hour clock. For example, to specify 11:00 P.M., type 2300.
  • -ut <EndTime>: Configures the printer for limited availability. Specifies the time of day the printer is no longer available. If you send a document to a printer when it is unavailable, the document is held (spooled) until the printer becomes available. You must specify time as a 24-hour clock. For example, to specify 11:00 P.M., type 2300.
  • -o <Priority>: Specifies a priority that the spooler uses to route print jobs into the print queue. A print queue with a higher priority receives all its jobs before any queue with a lower priority.
  • i <DefaultPriority>: Specifies the default priority assigned to each print job.
  • {+|-}shared: Specifies whether this printer is shared on the network.
  • {+|-}direct: Specifies whether the document should be sent directly to the printer without being spooled.
  • {+|-}published: Specifies whether this printer should be published in Active Directory. If you publish the printer, other users can search for it based on its location and capabilities (such as color printing and stapling).
  • {+|-}hidden: Reserved function.
  • {+|-}rawonly: Specifies whether only raw data print jobs can be spooled in this queue.
  • {+ | -}queued: Specifies that the printer should not begin to print until after the last page of the document is spooled. The printing program is unavailable until the document has finished printing. However, using this parameter ensures that the whole document is available to the printer.
  • {+ | -}keepprintedjobs: Specifies whether the spooler should retain documents after they are printed. Enabling this option allows a user to resubmit a document to the printer from the print queue instead of from the printing program.
  • {+ | -}workoffline: Specifies whether a user is able to send print jobs to the print queue if the computer is not connected to the network.
  • {+ | -}enabledevq: Specifies whether print jobs that do not match the printer setup (for example, PostScript files spooled to non-PostScript printers) should be held in the queue rather than being printed.
  • {+ | -}docompletefirst: Specifies whether the spooler should send print jobs with a lower priority that have completed spooling before sending print jobs with a higher priority that have not completed spooling. If this option is enabled and no documents have completed spooling, the spooler will send larger documents before smaller ones. You should enable this option if you want to maximize printer efficiency at the cost of job priority. If this option is disabled, the spooler always sends higher priority jobs to their respective queues first.
  • {+ | -}enablebidi: Specifies whether the printer sends status information to the spooler.
  • /?: Displays help at the command prompt.

Explanation with Examples

To display configuration information for the printer named ColorPrinter_2 with a print queue hosted by the remote computer named HRServer:

cscript Prncnfg.vbs -g -S HRServer -P ColorPrinter_2

To configure a printer named ColorPrinter_2 so that the spooler in the remote computer named HRServer keeps print jobs after they have been printed:

cscript Prncnfg.vbs -t -S HRServer -P ColorPrinter_2 +keepprintedjobs

To change the name of a printer on the remote computer named HRServer from ColorPrinter_2 to ColorPrinter 3:

cscript prncnfg.vbs -x -S HRServer -P ColorPrinter_2 -z “ColorPrinter 3”

Print

The Print command is used to add text files to a print queue. Because of limitations of text files it is not equal to the LP or LPR commands. The sole purpose of the Print command is simply to send a text file to a printer.

Syntax (view syntax formatting guide):

Print [/d:<PrinterName>] [<Drive>:][<Path>]<FileName>[ ...]

Syntax Explanation

  • /d:<PrinterName>: Specifies the printer that you want to print the job. To print to a locally connected printer, specify the port on your computer where the printer is connected.
    • Valid values for parallel ports are LPT1, LPT2, and LPT3.
    • Valid values for serial ports are COM1, COM2, COM3, and COM4.

You can also specify a network printer by using its queue name (\ServerNamePrinterName). If you do not specify a printer, the print job is sent to LPT1 by default.

  • <Drive>: Specifies the logical or physical drive where the file you want to print is located. This parameter is not required if the file you want to print is located on the current drive.
  • <Path>: Specifies the location of the file you want to print. This parameter is not required if the file you want to print is located in the current directory.
  • <FileName>[ …]: Required. Specifies the file you want to print. You can include multiple files in one command.
  • /?: Displays help at the command prompt.

Explanation with Examples

To send the file Report.txt in the current directory to a printer connected to LPT2 on the local computer:

print /d:lpt2 report.txt

To send the file Report.txt in the c:Accounting directory to the Printer1 print queue on the \CopyRoom server:

print /d:\copyroomprinter1 c:accountingreport.txt

 

Popd

The popd command changes the current directory to the directory that was most recently stored by the pushd command. The pushd command saves the current working directory in memory so it can be returned to at any time.

Syntax (view syntax formatting guide):

popd

Syntax Explanation

  • /?: Displays help at the command prompt.

Every time you use the pushd command, a single directory is stored for your use. However, you can store multiple directories by using the pushd command multiple times.
The directories are stored sequentially in a virtual stack. If you use the pushd command once, the directory in which you use the command is placed at the bottom of the stack. If you use the command again, the second directory is placed on top of the first one. The process repeats every time you use the pushd command.
You can use the popd command to change the current directory to the directory most recently stored by the pushd command. If you use the popd command, the directory on the top of the stack is removed from the stack and the current directory is changed to that directory. If you use the popd command again, the next directory on the stack is removed.

When command extensions are enabled, the popd command removes any drive-letter assignations created by pushd.

Explanation with Examples

The following example shows how you can use the pushd command and the popd command to save and return to a current working directory:

C:usersTom>pushd /

C:>pobd

C:userTom>

 

Perfmon

The Perfmon command allows you to start the Windows Reliability and Performance Monitor in a specific standalone mode. Perfmon, also known as “Performance Monitor”, got its roots as a command called, “sysmon.exe” in Windows 95, 98 and XP. The perfmon command is used to view information about a systems; CPU, Disk, Network and Memory statistics.

Syntax (view syntax formatting guide):

perfmon </res|report|rel|sys>

Syntax Explanation

  • /res: Start Resource View.
  • /report: Start the System Diagnostics Data Collector Set and display a report of the results.
  • /rel: Start Reliability Monitor.
  • /sys: Start Performance Monitor.

Explanation with Examples

To view the performance monitor in a standalone view:

c:perfmon

To view the resource monitor in a standalone view:

c:perfmon /res

To view the reliability monitor built into Windows Vista and 7:

c:perfmon /rel

 

Pentnt

The Pentnt Command assists in the detection floating point division error (if present) in the Pentium chipset. When used with the –f option, pentnt enables forced emulation. When used with the –o options, pentnt disables forced emulation and turns on floating point hardware.

Syntax (view syntax formatting guide):

pentnt [-c] [-f] [-o]

Syntax Explanation

  • -c: Enables conditional emulation.
  • -f: Enables forced emulation.
  • -o: Disables forced emulation and re-enables floating-point hardware if it is present.
  • /?: Displays help at the command prompt.

Parameters used with this command must be prefixed with (hyphen) rather than / (slash).

Using the -c command-line option 

Floating-point emulation is forced on only if the system detects the Pentium processor floating-point division error at start time. If you select this parameter, you must restart the computer for the changes to take effect.

Using the -f command-line option Floating-point hardware is disabled and floating-point emulation is always forced on, regardless of whether the system exhibits the Pentium processor floating-point division error. This parameter is useful for testing software emulators and for working around floating-point hardware defects known to the operating system. If you select this parameter, you must restart the computer for the changes to take effect.

Using the -o command-line option If you select this parameter, you must restart the computer for the changes to take effect.

Explanation with Example

To enable floating-point emulation regardless of whether or not there is a floating-point division error:

pentnt –f

To disable forced emulation and re-enable floating-point hardware if it is present:

pentnt -o

 

Pause

The Pause command suspends the processing of a batch program and displays the following prompt:

Press any key to continue . . .

This is beneficial in case you do not wish to complete the batch program or perhaps you need to give the user a chance to insert a new disk into the drive before continuing the batch.

Syntax (view syntax formatting guide):

pause

Syntax Explanation

  • /?: Displays help at the command prompt.

When you run the pause command, the following message appears: 


Press any key to continue . . .

If you press CTRL+C to stop a batch program, the following message appears: 


Terminate batch job (Y/N)?


If you press Y (for yes) in response to this message, the batch program ends and control returns to the operating system.

You can insert the pause command before a section of the batch file that you might not want to process. When pause suspends processing of the batch program, you can press CTRL+C and then press Y to stop the batch program.

Explanation with Examples

To create a batch program that prompts the user to change disks in one of the drives:

@echo off
:Begin
copy a:*.*
echo Put a new disk into drive A
pause
goto begin

In this example, all the files on the disk in drive A are copied to the current directory. After the message prompts you to put a new disk in drive A, the pause command suspends processing so that you can change disks and then press any key to resume processing. This batch program runs in an endless loop—the goto begin command sends the command interpreter to the Begin label of the batch file. To stop this batch program, press CTRL+C and then press Y.

 

Pathping

The Pathping command lists information about network latency and network loss at intermediate hops between a source and destination. This is different from the tracert command which only identifies the number of hops/routers between a source and destination. Pathping sends multiple Echo Request messages to each router between a source and destination over a period of time and then computes results based on the packets returned from each router. Because pathping displays the degree of packet loss at any given router or link, you can determine which routers or subnets might be having network problems. Used without parameters, pathping displays help.

Syntax (view syntax formatting guide):

pathping [-n] [-h MaximumHops] [-g HostList] [-p Period] [-q NumQueries[-w Timeout] [-i IPAddress] [-4 IPv4] [-6 IPv6][TargetName]

Syntax Explanation

  • -n: Prevents pathping from attempting to resolve the IP addresses of intermediate routers to their names. This might expedite the display of pathping results.
  • -h MaximumHops: Specifies the maximum number of hops in the path to search for the target (destination). The default is 30 hops.
  • -g HostList: Specifies that the Echo Request messages use the Loose Source Route option in the IP header with the set of intermediate destinations specified in HostList. With loose source routing, successive intermediate destinations can be separated by one or multiple routers. The maximum number of addresses or names in the host list is 9. The HostList is a series of IP addresses (in dotted decimal notation) separated by spaces.
  • -p Period: Specifies the number of milliseconds to wait between consecutive pings. The default is 250 milliseconds (1/4 second).
  • -q NumQueries: Specifies the number of Echo Request messages sent to each router in the path. The default is 100 queries.
  • -w Timeout: Specifies the number of milliseconds to wait for each reply. The default is 3000 milliseconds (3 seconds).
  • -i IPAddress: Specifies the source address.
  • -4 IPv4: Specifies that pathping uses IPv4 only.
  • -6 IPv6: Specifies that pathping uses IPv6 only.
  • TargetName: Specifies the destination, which is identified either by IP address or host name.
  • /?: Displays help at the command prompt.

Pathping parameters are case-sensitive.

To avoid network congestion, pings should be sent at a sufficiently slow pace.

To minimize the effects of burst losses, do not send pings too frequently.

When using the -p parameter, pings are sent individually to each intermediate hop. Because of this, the interval between two pings sent to the same hop is period multiplied by the number of hops.

When using the -w parameter, multiple pings can be sent in parallel. Because of this, the amount of time specified in the Timeout parameter is not bounded by the amount of time specified in the Period parameter for waiting between pings.

This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network adapter in Network Connections.

Explanation with Examples

The following example shows pathping command output:

pathping -n corp1

D:>pathping -n corp1

Tracing route to corp1 [10.54.1.196]
over a maximum of 30 hops:
  0  172.16.87.35
  1  172.16.87.218
  2  192.168.52.1
  3  192.168.80.1
  4  10.54.247.14
  5  10.54.1.196

Computing statistics for 125 seconds...
            Source to Here   This Node/Link
Hop  RTT    Lost/Sent = Pct  Lost/Sent = Pct  Address
  0                                           172.16.87.35
                                0/ 100 =  0%   |
  1   41ms     0/ 100 =  0%     0/ 100 =  0%  172.16.87.218
                               13/ 100 = 13%   |
  2   22ms    16/ 100 = 16%     3/ 100 =  3%  192.168.52.1
                                0/ 100 =  0%   |
  3   24ms    13/ 100 = 13%     0/ 100 =  0%  192.168.80.1
                                0/ 100 =  0%   |
  4   21ms    14/ 100 = 14%     1/ 100 =  1%  10.54.247.14
                                0/ 100 =  0%   |
  5   24ms    13/ 100 = 13%     0/ 100 =  0%  10.54.1.196

Trace complete.

When pathping is run, the first results list the path. This is the same path that is shown using the tracert command. Next, a busy message is displayed for approximately 90 seconds (the time varies by hop count). During this time, information is gathered from all routers previously listed and from the links between them. At the end of this period, the test results are displayed.

In the sample report above, the This Node/Link, Lost/Sent = Pct and Address columns show that the link between 172.16.87.218 and 192.168.52.1 is dropping 13 percent of the packets. The routers at hops 2 and 4 also are dropping packets addressed to them, but this loss does not affect their ability to forward traffic that is not addressed to them.

The loss rates displayed for the links, identified as a vertical bar (|) in the Address column, indicate link congestion that is causing the loss of packets that are being forwarded on the path. The loss rates displayed for routers (identified by their IP addresses) indicate that these routers might be overloaded.

 

Path

The Path command sets the command path in the PATH environment variable (the set of directories used to search for executable files). If used without parameters, path displays the current command path.

Syntax (view syntax formatting guide):

path [[<Drive>:]<Path>[;...][;%PATH%]]
path ;

Syntax Explanation

  • [Drive:]Path: Specifies the drive and directory to set in the command path.
  • [;]: Separates directories in the command path. If used without other parameters, ; clears the existing command paths from the PATH environment variable and directs Cmd.exe to search only in the current directory.
  • %PATH%: Appends the command path to the existing set of directories listed in the PATH environment variable.
  • [/?]: Displays help at the command prompt.

When you include %PATH% in the syntax, Cmd.exe replaces it with the command path values found in the PATH environment variable, eliminating the need to manually enter these values at the command prompt.

The current directory is always searched before the directories specified in the command path.

You might have files in a directory that share the same file name but have different extensions. For example, you might have a file named Accnt.com that starts an accounting program and another file named Accnt.bat that connects your server to the accounting system network. 
The Windows operating system searches for a file by using default file name extensions in the following order of precedence: .exe, .com, .bat, and .cmd. To run Accnt.bat when Accnt.com exists in the same directory, you must include the .bat extension at the command prompt.

If two or more files in the command path have the same file name and extension, path first searches for the specified file name in the current directory. Then it searches the directories in the command path in the order that they are listed in the PATH environment variable.

If you place the path command in your Autoexec.nt file, the Windows operating system automatically appends the specified MS-DOS subsystem search path every time you log on to your computer. Cmd.exe does not use the Autoexec.nt file.

When started from a shortcut, Cmd.exe inherits the environment variables set in My Computer/Properties/Advanced/Environment.

Explanation with Examples

To search the paths C:UserTaxes, B:UserInvest, and B:Bin for external commands:

path c:usertaxes;b:userinvest;b:bin

 

 

 

Ntbackup

The ntbackup command is a built-in backup utility that allows you to backup and restore full, differential and incremental backups of critical system files and data. Ntbackup was introduced in Windows NT in 1997 and is supported on Windows NT, 2000, XP and Windows 2003. Ntbackup is not available in Windows Vista or Windows Server 2008. Instead, you should use the wbadmin command and subcommands to back up and restore your computer and files from a command prompt.

It is important to note that you cannot recover backups that you created with ntbackup by using wbadmin. However, a version of ntbackup is available as a download for Windows Server 2008 and Windows Vista users who want to recover backups that they created using ntbackup. This downloadable version of ntbackup enables you to perform recoveries only of legacy backups, and it cannot be used on computers running Windows Server 2008 or Windows Vista to create new backups. To download this version of ntbackup, see http://go.microsoft.com/fwlink/?LinkId=82917.