Posted on 2003-03-27
Medium Priority
Last Modified: 2010-04-13

i'm trying to delete network printers via a registry key in a login script. I'm trying to make this registry key addition run silently, but everytime I test it a box comes up saying "Are you sure you want to add the information to the registry?"

Can anyone help?

The Registry key is:

Windows Registry Editor Version 5.1


regedit.exe /s %LOGONSERVER%\DeleteAllPrinters.reg
Question by:COOPER143
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
LVL 12

Expert Comment

ID: 8219080
use regedit -s instead of regedit /s

Many Regards

Jorgen Malmgren

Author Comment

ID: 8219262
I tried that..Same message?

Expert Comment

ID: 8219592
I do not believe you can silently import into the registry using regedit.  You can, however, do it with vbscript.  The machines running the loginscript would have to be able to run vbscripts (it should be on most windows machines unless you have specifically removed it).  Below is a sample script that reads a registry value, and if it is greater than or equal to 1, then it changes it to 0.

set wscr=CreateObject("WScript.Shell")
rr=wscr.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows Scripting Host\Settings\Timeout")
if (rr>=1) then
wscr.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows Scripting Host\Settings\Timeout",0,"REG_DWORD"
end if
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

LVL 85

Accepted Solution

oBdA earned 1000 total points
ID: 8220701
Sigh - why is everybody trying to mess directly with the registry when there are enough official tools to achieve the desired goal?
To delete mapped network printers, you can either use (from the resource kit)
con2prt.exe /f
rundll32 printui.dll,PrintUIEntry /dn /n <printer name>
(try rundll32 printui.dll,PrintUIEntry /? for a list of possible switches; note that PrintUIEntry is case sensitive.)
LVL 10

Expert Comment

ID: 8220961

And, yes, you can use REGEDIT /S to update the registry silently.

If you are determined to use the registry (instead of oBdA's elegant answer) you may want to try using the "REG DELETE /?" command and view the options presented there.


Author Comment

ID: 8225154
I forgot about the con2prt.exe /f....

It worked great!

Thanks for everyone's help.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

762 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