Jump to content

Recommended Posts

Posted

anyone know how to set the default printer to the local printer, if its present??

i currently run a batch script that maps network drives, any idea how to set the locally installed printer to default without manually doing it?

 

maybe deleting all the network printers would set the local as default, then mapping the network printers again????

 

:confused:.COM!

Posted

The following vbscript should do it:

 

Dim oPrinters

Set shell= WScript.CreateObject("WScript.Shell")
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set oPrinters = WshNetwork.EnumPrinterConnections


For i = 0 to oPrinters.Count - 1 Step 2
if oPrinters.Item(i) = "LPT1:" then
      		wshnetwork.setdefaultprinter oPrinters.Item(i)
elseif oPrinters.Item(i) = "USB001" then
	wshnetwork.setdefaultprinter oPrinters.Item(i)
      	end if
Next

 

This assumes printer is installed on port LPT1: or USB001.

  • Thanks 1
Posted

You can use the following to do it remotly.

 

RUNDLL32 PRINTUI.DLL,PrintUIEntry /c \\ICT1-01 /ga /n "\\server2.curriculum.airedalehigh.com\ITC-1"

RUNDLL32 PRINTUI.DLL,PrintUIEntry /c \\ICT1-01 /y /n "\\server2.curriculum.airedalehigh.com\ITC-1"

 

2 stage's first on add's seconds sets as default.

 

D

  • 3 weeks later...
Posted

We currently use a logon script that points to a registry file on the C drive of the pc. Its an export of the default printer setting. So when the logon script reads this file it plants the registry key and defaults to that printer.

 

for example we use Kix32 as our logon script

 

If EXIST ("c:\hplj.txt") = 1

shell "cmd /c @LDRIVE\logonscripts\printers\hplj.bat"

?"Default Printer Set...."

EndIf

 

Bat file contents

 

c:\windows\regedit /s c:\hplj.reg

 

reg file on C drive contents (hplj.reg)

 

Windows Registry Editor Version 5.00

 

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows]

"DebugOptions"="2048"

"Documents"=""

"DosPrint"="no"

"load"=""

"NetMessage"="no"

"NullPort"="None"

"Programs"="com exe bat pif cmd"

"Device"="Admin_Mono,winspool,Ne00:"

 

 

So in short, i export the above registry key to the C drive as hplj.reg (could be named anything you want) The person logs in and this file changes the default printer.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...