Solved

add printer

Posted on 2014-11-21
5
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
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.

689 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