Jump to content
Sign in to follow this  

Printer as another user

Recommended Posts


Hi! I want to run an exe file as a user (with runas) and view the printers installed for another user. How can I do it???


Share this post

Link to post
Share on other sites


Welcome to the forum.

What Windows Version are you talking about?

google: printui.dll, e.g. this MS Technet explanation.

iirc there is some example code for listing all installed printers here in the forum. Use google to search the forum ;)

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post

Link to post
Share on other sites

See helpfile for RunAs or RunAsWait function

and for see the default printer try :

ConsoleWrite ( "DefaultPrinter : " & _GetDefaultPrinter() & @Crlf )

Func _GetDefaultPrinter()
    Local $a_iCall = DllCall("winspool.drv", "int", "GetDefaultPrinterW", "wstr", "", "dword*", 0)
    If @error Or $a_iCall[0] Then Return SetError(1, 0, "")
    Local $iBufferSize = $a_iCall[2]
    $a_iCall = DllCall("winspool.drv", "int", "GetDefaultPrinterW", "wstr", "", "dword*", $iBufferSize)
    If @error Or Not $a_iCall[0] Then Return SetError(1, 0, "")
    Return SetError(0, 0, $a_iCall[1])
EndFunc   ;==>_GetDefaultPrinter

AutoIt X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.