1

I have a Windows XP machine that runs two applications and both print on a thermal printer connected by a serial port.

For one application, the "Generic / Text Only" printer must be present, for the other to work I need to remove it.

I've found a few .vbs scripts, but they are for network printer. How do I make them work with my local printer? Is there a better solution? The user would have to run the script every time he needs to switch from an application to another.

2 Answers 2

0

delete local printer:

rundll32 printui.dll,PrintUIEntry /dl /n "HP DesignJet 755CM/PS" 

install local printer:

rundll32 printui.dll,PrintUIEntry /if /b "HP DesignJet 755CM/PS" /f  "%windir%\inf\ntprint.inf " /r "FILE:" /m "HP DesignJet 755CM/PS"

Set printer as default:

rundll32 printui.dll,PrintUIEntry /y /n "HP DesignJet 755CM/PS"
2
  • 1
    Works! But I just needed to change "FILE:" to "COM1:"
    – GxFlint
    Jun 29, 2013 at 22:07
  • @GxFlint That's right. At the moment I do not have a printer with COM port. This example will work almost everywhere on a family windows.
    – STTR
    Jun 30, 2013 at 10:50
0

I do not have the capabilities yet to ask questions in a comment, so I'm going to try and help with an answer... Yes you can write VBS which would be handy to have for switching printers, but are you writing the VBS to change defaults or actually "remove" it as in uninstall? And is this one printer or two? It seems from your question that two applications print from the same printer.

I do know with some programs you can actually set a printer for that program even if the default printer is a different one (using MS Access as an example).

If the user is not able to change printers with their level of permissions then you will probably have to have a piece of script to override and change it for them.

1
  • It's just one printer that is shared by the applications. For one of them to use it, the printer needs to be "removed" uninstalled. It's not about the default printer.
    – GxFlint
    Jun 29, 2013 at 19:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .