Which Of The Following Commands Would Allow You To Determine If A Service Or Driver
Today we'll talk almost opportunities of managing printers and their drivers from the command prompt in Windows 10/ 8.one and Windows Server 2012 R2/ 2016. We will consider how to install a new local or network printer, print driver, create a TCP/IP print port, print a test page, delete a driver or printer using uncomplicated Windows commands. It tin exist useful in various scenarios unattended printer installation in SCCM tasks, logon scripts of the group policies and on the servers running in the Server Core mode.
Contents:
- Ready-to-Utilize VBS Scripts to Manage Printers in Windows
- How to Install a Printer Driver from the Command Line?
- How to Add a New Printer from the Command Prompt?
- Managing Default Printer Using CMD
- How to Create a TCP/IP Port for a Network Printer?
- How to Print a Test Page from the CMD?
- Manage Impress Queues from the Command Prompt
- Share a Network Printer Using the Command Line
- How to Add a Network Printer via the Command Line?
- How to Remove a Printer and Its Driver from the Control Prompt?
Prepare-to-Utilize VBS Scripts to Manage Printers in Windows
To manage printers, Microsoft has adult several VBS scripts that allow you to manage printers and print queues, install and uninstall printer drivers, etc.
These scripts are present in all Windows versions (starting from Vista and Windows Server 2008) and are located in the directory C:\Windows\System32\Printing_Admin_Scripts\en-U.s.a..
Note.
- Instead of en-United states of america directory, there can exist some other directory corresponding to the organisation language;
- In Windows XP and 2003 these VBS scenarios are stored in the C:\WINDOWS\system32 directory.
The following VBS scripts are located in this folder:
- Prncnfg.vbs – a script to display information almost the printer settings;
- Prndrvr.vbs – printer driver management (install / uninstall printer drivers);
- Prnjobs.vbs – managing print jobs;
- Prnmngr.vbs – managing printers (including creating and removing printer in the system);
- Prnport.vbs – managing connection to the remote printer via TCP/IP ports;
- Prnqctl.vbs – print queue management;
- Pubprn.vbs – managing printer publishing in Active Directory.
Note. Ane of the well-known ways of managing printers in different versions of Windows is the host process rundll32.exe, which receives the name of the library printui.dll and the entry point to it (PrintUIEntry). The control rundll32 printui.dll,PrintUIEntry is plenty to perform basic operations with printers and is fully supported by Microsoft, merely the apply of specified vbs scripts is preferable from the administrator betoken of view.
Let's consider typical scenarios of using these VBS scripts.
How to Install a Printer Driver from the Command Line?
Permissions to install and configure local printers are bachelor for members of the following local groups: Administrators, Print Operators or Server groups.
Install the HP printer driver using the command:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -g "HP Universal Printing PCL 6" -i "C:\drv\HP Universal Print Driver\hpcu160u.inf"
Permit'due south consider the parameters of the control:
-a – add printer commuter;
-m "HP Universal Printing PCL six"– the name of the printer driver;
-i "path" – the total path to the driver'south INF file.
Afterwards the driver is installed, it appears in the print server properties (Command Panel\Hardware and Sound\Devices and Printers -> Print Server Backdrop).
Note. If you are using an incompatible printer commuter, you can install it manually.
How to Add a New Printer from the Command Prompt?
Using the following command, yous tin install a new printer named HP5525 using the previously installed HP Universal Printing PCL half-dozen print driver:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -a -p "HP5520" -g "HP Universal Press PCL six" -r "lpt1:"
-a – a new local printer is installed;
-p "HP5520" – a display name of the printer;
-grand "HP Universal Press PCL 6" – a print commuter that is used;
-r "lpt1:" – a name of the local print port used. In this case, printing should exist performed through the LPT port. Here y'all tin can specify the parallel port (LPT1:, LPT2:), serial (COM1:, COM2: – before installation, brand sure that this COM port is not used by another device) or USB port (USB001, etc.).
Managing Default Printer Using CMD
From the control line, y'all can choose which printer to employ for default press. With the following command you can list all installed printers:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" –50
You can become the proper noun of the current default printer:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" –grand
The default printer is HP Universal Printing PCL half-dozen (redirected 1)
To set a different default printer, run the command:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -t –p "HP5525"
How to Create a TCP/IP Port for a Network Printer?
If you desire to connect a network printer, you lot must first create a TCP/IP printer port for it (suppose the printer IP address is 192.168.one.22):
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-Us\Prnport.vbs" -a -r IP_192.168.1.22 -h 192.168.1.22 -o raw -n 9100
-r IP_192.168.1.22 – a name of the network port;
-h 192.168.ane.22 – IP address of the device;
-o raw – a port type (raw or lpr);
-n 9100 – the number of the TCP port of the device (unremarkably 9100).
And then you tin can install a new network printer on the arrangement:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs" -a -p "HP5525" -m "HP Universal Printing PCL half dozen" -r " IP_192.168.1.22"
Later on the script is over, a new printer HP5525 appears in the system.
How to Print a Test Folio from the CMD?
To print a examination page on the printer y'all have created, practice the following:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnqctl.vbs" -e -p "HP5525"
Manage Impress Queues from the Command Prompt
Using the prnjobs.vbs script, you tin can view print jobs in queues. To brandish all impress jobs for all local printers, run the command:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prnjobs.vbs" –50
To display jobs on a specific printer, you need to specify its proper name:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-U.s.\prnjobs.vbs" –l –p HP5525
To clear the print queue on 1 printer, run the following command:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-U.s.a.\prnjobs.vbs" –ten –p HP5525
Or yous tin can quickly clear all queues for all printers (this is much more user-friendly than manually cleaning the print queues):
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-Usa\prnjobs.vbs" –ten
Share a Network Printer Using the Command Line
All new printers that you installed in Windows from the command prompt are local. You tin can share them with other users over the network from the Windows GUI (see the article). You tin as well share the printer from the control line. For instance, you want to provide network admission to your HP5525 printer by publishing it under the proper name HP5525_Shared. Utilise the control:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-Usa\prncnfg.vbs" -t -p HP5525 -h "HP5525_Shared" +shared
To disable printer sharing, run:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-The states\prncnfg.vbs" -t -p "HP5525" -shared
Similarly, you tin can publish a printer in Active Directory:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-Us\prncnfg.vbs" -t -p HP5525 +published
To remove printer from the Advert, utilise the "-published" argument.
How to Add a Network Printer via the Control Line?
To connect a shared network printer connected to another computer, employ the
control:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-U.s.a.\prnmngr.vbs" -ac -p "\\rome-prnt01\hp2100"
Quite frequent errors when connecting network printers – 0x00000002, 0x00000057 and 0x0000007e. Ways to solve errors are available at the links to a higher place.
How to Remove a Printer and Its Commuter from the Command Prompt?
A complete list of printers in the system can be displayed as:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-U.s.a.\prnmngr.vbs" -fifty
A printer can be removed with the post-obit command:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-U.s.\prnmngr.vbs" -d -p "HP5525"
The print driver is deleted as follows:
cscript "C:\Windows\System32\Printing_Admin_Scripts\en-U.s.\prndrvr.vbs" -d -1000 "HP Universal Printing PCL half dozen" -east "Windows x64" -v 3
In this article nosotros looked the basic operations with good old Microsoft VBS scripts that allow to manage printers and their drivers from the command line in various Windows versions. A complete list of the capabilities and arguments of these scripts are available in Microsoft documentation or in the in-congenital help of the scenarios (but run the script file without parameters in the control line).
In the next article we will innovate a new opportunities of printer management in Windows ten / 8.i and Windows Server 2016 / 2012 R2 provided by PowerShell.
Which Of The Following Commands Would Allow You To Determine If A Service Or Driver,
Source: http://woshub.com/manage-printers-and-drivers-from-the-command-line-in-windows-8/
Posted by: poteatprody2002.blogspot.com
0 Response to "Which Of The Following Commands Would Allow You To Determine If A Service Or Driver"
Post a Comment