Solved

add printer

Posted on 2014-11-21
5
161 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
hardrive and reformat 5 82
Downgrade From Domain to WorkGroup 3 38
Exchange 2010 offline Address Book (OAB) not updating 10 39
VBA taking too long 5 15
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
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 introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

776 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