Jump to content

creating a local printer


Recommended Posts

does anyone have any ideas of how to create a local printer for a user that is not an admin ? ie setup the device and install the drivers that come with a HP 1022n laser printer

i have no idea where to start

thanks

ok since this post i checked out the rundll32 commands for setting up a local printer and from dos its

rundll32 printui.dll,PrintUIEntry /ia /m "AGFA-AccuSet v52.3" /h "Intel" /v "Windows 2000 or XP" /f %windir%\inf\ntprint.inf

but how can i run that using DLLCALL ? totally new to the dll commands.

Link to comment
Share on other sites

ok since this post i checked out the rundll32 commands for setting up a local printer and from dos its

rundll32 printui.dll,PrintUIEntry /ia /m "AGFA-AccuSet v52.3" /h "Intel" /v "Windows 2000 or XP" /f %windir%\inf\ntprint.inf

but how can i run that using DLLCALL ? totally new to the dll commands.

actually i think this has been covered in the forums before; the printers are all in the registry, you can just write the registry key that's needed, and then refresh the update... search the forums and you'll find steps for both of those...
Link to comment
Share on other sites

actually i think this has been covered in the forums before; the printers are all in the registry, you can just write the registry key that's needed, and then refresh the update... search the forums and you'll find steps for both of those...

thanks but i ended up using this code to install the drivers and setup the printer.

#include <Process.au3>
#include <File.au3>
#include <Array.au3>

DirCreate("c:\temp\hp1022n\driver")

; file being installed here is a self extracting zip
FileInstall("driver.exe", "c:\temp\hp1022n\*.*")

RunAsSet("administrator",@ComputerName, "password here")

; extract files here
Runwait( "c:\temp\hp1022n\driver.exe /auto c:\temp\hp1022n\" )

; install the printer (must be connected for it to find the USB001 port.
_RunDOS( 'rundll32 printui.dll,PrintUIEntry /if /b"Portable - HP LaserJet 1022n" /r "usb001" /m "HP LaserJet 1022n" /f "c:\temp\hp1022n\driver\HPLJ1020.INF"')

; remove temp files
DirRemove("c:\temp\hp1022n" ,1 )
Edited by craig.gill
Link to comment
Share on other sites

thanks but i ended up using this code to install the drivers and setup the printer.

#include <Process.au3>
#include <File.au3>
#include <Array.au3>

DirCreate("c:\temp\hp1022n\driver")

; file being installed here is a self extracting zip
FileInstall("driver.exe", "c:\temp\hp1022n\*.*")

RunAsSet("administrator",@ComputerName, password here

; extract files here
Runwait( "c:\temp\hp1022n\driver.exe /auto c:\temp\hp1022n\" )

; install the printer (must be connected for it to find the USB001 port.
_RunDOS( 'rundll32 printui.dll,PrintUIEntry /if /b"Portable - HP LaserJet 1022n" /r "usb001" /m "HP LaserJet 1022n" /f "c:\temp\hp1022n\driver\HPLJ1020.INF"')

; remove temp files
DirRemove("c:\temp\hp1022n" ,1 )
good deal. thanks for posting the solution you went with so that this topic will help others.
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...