Results 1 to 7 of 7

Thread: Script to add http printer in Windows XP

  1. #1
    Join Date
    May 2012
    Posts
    136

    Script to add http printer in Windows XP

    I have multiple computers and multiple printers in my office. At present, we have only few computers, maybe two or three computers with access to these printers. The person who needs to take print out of some data needs to pass the file to the respective person responsible for handling them. This whole setup needs to be changed such that I can give access to a person who will be needing printer for some time and then again revoke the permissions. Also if new printer is added, then I can add the new printer without having to install the whole setup and go through control panel. Can someone tell me if there is any way to achieve it?

  2. #2
    Join Date
    Jun 2011
    Posts
    869

    Re: Script to add http printer in Windows XP

    I think I can help you with a script that I have. You can use this script with various possibilities by use of different changes you can make in it. The base syntax is,

    Code:
    set /p room=Room number in which the printer is located.
    rundll32 printui.dll,PrintUIEntry /in /n "http://172.16.28.25:631/printers/%room%" /m "MS Publisher Imagesetter"
    echo Room %room% printer installed. You are now ready to use the printer.
    This script is to add new printer to the network whose control you will get. So if you want to change some property or functioning of the printer, you will need to edit the part between semi-colons.
    Some of the command lines are like,

    1. RUNDLL32 PRINTUI.DLL,PrintUIEntry /p /n\\machine\printer for checking the properties of the printer.
    2. RUNDLL32 PRINTUI.DLL,PrintUIEntry /o /n\\machine\printer to view the print requests in queue.
    3. RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "printer" to make a certain printer as default.

    I use these much commands only. You need to find other commands if you needs much details about it.

  3. #3
    Join Date
    Jul 2011
    Posts
    427

    Re: Script to add http printer in Windows XP

    Actually the code mentioned by above user is to edit the driver settings of the printer. So before making any changes have the original driver ready for install. I too have same setup as you are asking for. Here are some more codes that you might find useful.

    • To check the server properties, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /s /t1 /n\\machine
    • To add printer wizard locally, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /il
    • To add printer wizard on \\machine, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /il /c\\machine
    • To perform an inf install, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /b "Test Printer" /f %windir%\inf\ntprint.inf /r "lpt1:" /m "AGFA-AccuSet v52.3"
    • To add printer wizard using inf, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /ii /f %windir%\inf\ntprint.inf
    • To add printer permission to a specific machine, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /ga /c\\machine /n\\machine\printer /j"LanMan Print Services"
    • To delete printer connection from a specific machine, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /gd /c\\machine /n\\machine\printer
    • To assign group of machines with printer connections, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /ge /c\\machine

  4. #4
    Join Date
    Nov 2010
    Posts
    446

    Re: Script to add http printer in Windows XP

    Many times it is observed that on TCP/IP connection, using the RUNDLL32 doesn’t help as it tends to not work on certain systems. This happens mostly in network where certain computers have Windows 7 installed on them while others have Windows XP on them. The RUNDLL32 used in Windows 7 is quite different than that used in Windows 7, thus this difference. At such times, you will need to use Windows 2000 Server or Windows Server 2003 Resource Kit. After you have installed this on the server, you can use PRNADMIN.DLL instead of RUNDLL32.

  5. #5
    Join Date
    May 2011
    Posts
    368

    Re: Script to add http printer in Windows XP

    If you need some more commands that will help you with setting up multiple printers with multiple computers, then I can provide you with some codes too. They are really helpful and have helped me since long time. Check out if anything is useful for you, maybe you’ll find something.

    1. You will be able to Add printer driver using inf by use of RUNDLL32 PRINTUI.DLL,PrintUIEntry /ia /c\\machine /m "AGFA-AccuSet v52.3" /h "Intel" /v "Windows 2000" /f %windir%\inf\ntprint.inf
    2. You will be able to remove printer driver by use of RUNDLL32 PRINTUI.DLL,PrintUIEntry /dd /c\\machine /m "AGFA-AccuSet v52.3" /h "Intel" /v "Windows 2000"
    3. You will be able to set printer as default by use of RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "printer"
    4. You will be able to set printer comment by use of RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xs /n "printer" comment "This is my Printer"
    5. You will be able to set printer port by use of RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xs /n "printer" PortName "port:"
    6. You will be able to get printer settings by use of RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xg /n "printer"
    7. You will be able to get printer settings saving results in a file by use of RUNDLL32 PRINTUI.DLL,PrintUIEntry /f "results.txt" /Xg /n "printer"

  6. #6
    Join Date
    Mar 2011
    Posts
    415

    Re: Script to add http printer in Windows XP

    I have been reading this code and let me tell you one thing that you will be directly messing with the printer drivers that are installed in your computer. It is safe to have backup of the printer’s drivers’ so that if something gets screwed up, you can at least restore back the old settings. You can’t just copy paste the drivers around and expect them to run properly. You need to get them out methodically by use of Microsoft's PrintMig tool. This tool will help you in selective back up and other things related to it.

  7. #7
    Join Date
    Jul 2011
    Posts
    427

    Re: Script to add http printer in Windows XP

    Here I found some other commands that I had written in my old notebook. Here they are, guess they will also prove useful for you.

    • To get printer settings saving results in a file, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /f "results.txt" /Xg /n "printer"
    • To set printer settings command usage, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xs /n "printer" ?
    • To store all printer settings into a file, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /n "printer" /a "file.dat"
    • To restore all printer settings from a file, use RUNDLL32 PRINTUI.DLL,PrintUI /Sr /n "printer" /a "file.dat"
    • To store printer information on level 2 into a file, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /n "printer" /a "file.dat" 2
    • To restore from a file printer security descriptor, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n "printer" /a "file.dat" s
    • To restore from a file printer global devmode and printer data, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n "printer" /a "file.dat" g d
    • To restore from a file minimum settings and resolve port name, use RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n "printer" /a "file.dat" m p

Similar Threads

  1. Script to Install Printer Drivers w/o adding printer
    By witecoko in forum Windows XP Support
    Replies: 7
    Last Post: 13-03-2013, 11:32 AM
  2. Printer script help
    By bsando in forum Software Development
    Replies: 1
    Last Post: 30-04-2011, 01:42 AM
  3. Printer Script Issue on my Network Printer
    By loll in forum Networking & Security
    Replies: 1
    Last Post: 17-01-2011, 11:31 PM
  4. HTTP Error 404.17 The requested content appears to be script
    By pakru in forum Networking & Security
    Replies: 5
    Last Post: 19-05-2010, 08:34 PM
  5. Use logon script to map network printer
    By Mitch in forum Windows Server Help
    Replies: 4
    Last Post: 18-12-2008, 08:25 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,296,098.07775 seconds with 17 queries