?
Solved

add printer

Posted on 2014-11-21
5
Medium Priority
?
166 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 2000 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
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 teach you how to change your appearance and customize your Windows 7 interface to your unique preference. 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 editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
Suggested Courses
Course of the Month12 days, 2 hours left to enroll

752 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