Printer Wizard Executable - Windows XP

Discussion in 'Software' started by Mada_Milty, Sep 14, 2006.

  1. Mada_Milty

    Mada_Milty MajorGeek

    Hi All,

    I'm trying to figure out what files actually run common administrative functions, so that I do not have to log users out to do simple things like add printers. For example, I've found out that the My Computer properties dialog is actually a file called sysdm.cpl, and I can use the Run As command to say, add remote desktop users without logging out the user. I would like to find out which file launches the Printers And Faxes wizard so that I can re-install printers for users without telling them to save their work and go get a cup of coffee. I can't find the darn thing. Does anyone have this info off the top? Google's not being my friend today.

    Regards,

    Milty
     
  2. darksidesh

    darksidesh Private E-2

    Google a program called CPAU. This is much better than the RunAs command.

    The command "RUNDLL32 printui.dll,PrintUIEntry /il /z" without the quotes will launch the Add Printers wizard.

    Once you download the CPAU you can actually create a batch file similar to this string:

    CPAU.exe -u %adminID% -p %adminPW% -profile -ex "RUNDLL32 printui.dll,PrintUIEntry /il /z"


    %adminID% is your administrative account. For most people this is Administrator so just replace %adminID% with Administrator in the above statement. %adminPW% is the password for the administrative account so replace %adminPW% with your Administrator password. For example, my administrator account is Bob, and the password is "hi". The string should be: CPAU.exe -u Bob -p hi -profile -ex "RUNDLL32 printui.dll,PrintUIEntry /il /z"


    Once you create the batch file with the, the batch file and CPAU must be in the same folder in the example given above. Run the batch file, and it will run the Add Printers Wizard with administrative rights regardless of the users’ privileges.

    Note: this is not the most secure way since the user may find out your administrative accounts name and password, but I find it useful when I care it on a USB stick or a secure network share and run it from their computer.

    Hope this helps.
     
  3. matt.chugg

    matt.chugg MajorGeek

    As you can see from darksides post these types of dialogs are not really programs, rather they are dialogs and functions in core dll files (shell32.dll etc) and can be invoked using rundll32 (short for run a dll as an application)

    In the case of printers everything will be in printui.dll, and there a numerous different things you can do

    Launches the Add New Printer wizard:
    • RunDll32.exe SHELL32.DLL,SHHelpShortcuts_RunDLL AddPrinter
    • RunDLL32.EXE RunDLL32 SysDM.cpl,InstallDevice_RunDLL Printer,,0 (**)

    Launches the Add Standard TCP/IP Printer Port Wizard:
    • RunDll32.exe tcpmonui.dll,LocalAddPortUI

    Launches the Connect to Network Printer dialog:
    • RunDll32.exe WINSPOOL.DRV,ConnectToPrinterDlg

    This will open the printers folder
    • RunDll32.exe SHELL32.DLL,SHHelpShortcuts_RunDLL PrintersFolder

    Print Test Page
    • RunDll32.exe SHELL32.DLL,SHHelpShortcuts_RunDLL PrintTestPage

    Also: How to add printers with no user interaction in Windows
     
  4. matt.chugg

    matt.chugg MajorGeek

    by the way darkside theres no need for a 3rd party application to use run as, runas is a valid commandline argument, it doesn't let you input the password for the account but it does ask for it on the command line which is a bit more secure than saving it in a batch file

    try runas /user:administrator notepad.exe ;)
     
  5. Mada_Milty

    Mada_Milty MajorGeek

    Dammit! I was hoping it wasn't a dll file. Thanks for the replies, though...some great stuff. I'll definitely have to set something up. I was also wondering about runas on the command line, so that filled a gap I hadn't even asked about! Cheers!
     
  6. Mada_Milty

    Mada_Milty MajorGeek

    Alright, know I'm digging up an oldie here, but I've found something nifty.
    I actually feel stupid for not realizing this sooner.

    Administrators don't need to do anything fancy to add printers remotely! They can do it through Windows Explorer! You can access a remote user's 'Printers And Faxes' window by accessing the machine in 'My Network Places'. This allows you to add LOCAL printers without logging them off. You can't add a network printer, but you don't need administrative privledges to do that in XP (by default).

    So handy, yet I never investigated it until yesterday!
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds