Solved

add printer

Posted on 2014-11-21
5
160 Views
Last Modified: 2014-11-25
at work someone came up with this script

@ECHO OFF
rundll32 printui.dll,PrintUIEntry /ga /c\\%1 /n\\%2
pause

it is saved as

addprnt.cmd

so if I open a command prompt as admin, and run

addprnt.cmd  computername   printerservername\printername

it adds the printer for anyone that logges into the computer. and this works very well. so this same person made another scritp

@echo off
rundll32 printui.dll, PrintUIEntry /ge /c\\%1
pause

saved as

chkprnt.cmd

and is run at an elevated command prompt as

chkprnt.cmd  computername

this also seems to run well, however, I was wondering, is there another way to check for printers that are added with the first script? such as, would there be something in the registry or something like that? I ask because I ran the chkprnt.cmd command on a computer and only came up with one printer. For the computer I ran this on, I thought there would be more.
0
Comment
Question by:JeffBeall
  • 3
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
ZabagaR earned 500 total points
ID: 40458549
There are printer utilities in windows 7 in C:\windows\system32\Printing_Admin_Scripts\en-US\

I copied those .vbs files to c:\windows\system32\ for my examples below:

cscript c:\windows\system32\prnmngr.vbs -l

That will LIST all printers locally, that's what the -l does

For a remote PC using your %1 parameter:

cscript c:\windows\system32\prnmngr.vbs -l -c %1

Basically -c is for "remote computer name"
0
 
LVL 1

Author Comment

by:JeffBeall
ID: 40459959
I forgot about those scripts! I ran prnmngr.vbs -l locally on the computer, but it only showed the virtual printers like the office printer.
0
 
LVL 1

Author Comment

by:JeffBeall
ID: 40459976
rundll32 printui.dll,PrintUIEntry /ga

must somehow make the printers not local printers. I was googling this problem and saw something about how network printers are supposed to be listed in the registry but I've tried so many things, I'm losing track. I don't suppose it would work to remove printers listed in the registry?
0
 
LVL 15

Expert Comment

by:ZabagaR
ID: 40460669
I don't recall the reg key off hand but all printers are in a subkey in the registry. You could google that....plus run a reg query command to list them out. I'm out of the country on vacation for a week so I'm not going to be too much help at this point!
0
 
LVL 1

Author Closing Comment

by:JeffBeall
ID: 40464778
Thank you for the help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP CDO - Limiting Connections 2 40
HP Deskjet 2132 12 61
Pervasive SQL Error 4 24
Choice of Win 7 or Win 10 for New Dell 5810 Workstation 13 26
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now