Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: NetAddPrinter n4captureprt
I think I have found all the registry keys.
The network printers already exist and are in the printers menu. I just need to change the port capture in a simplified manner.
The function does not add a printer to the printer menu, just to the copy of currently running Windows. It maps drivers very well. Note that AddPrinter is not an InstallPrinter. The "AddPrinter" types of functions simply "map" or "Connect" a pre-existing printer.
Adding a printer to the printer menu is much more of a fight.
If a user boots up, chooses the winbatch script to print to a network printer, prints (successfully), and then chooses to switch to the local printer it will not work.
If the user boots up, chooses the local printer script, prints, everything works fine all day. As long as the user prints to the local printer first, everything is ok...
The problem is when the user prints to the network first, where I'm doing an n4CapturePrt. Is there something else I can put in the script to not cause this problem? I am using the newest version of Winbatch.
;;32 bit Devmode.wbt ;;WM_DEVMODECHANGE (DMC) message: DMC=27 DaDll=Strcat(DirWindows(1),"USER32.DLL") DllCall( DaDll, long:"SendMessageA", long:-1, long:DMC, long:0, lpstr:newdevice) Message(0,1)Do the n4CaptureEnd at the end of your network printer script before running your local printer script, since you can't set a local printer to print to a LPT port that has been captured to a network printer queue.
From your description it looks 99% like you are getting the registry and win.ini settings very very very close, and when you first print to the local printer it is close enough for windows to guess at the correct solution.
The idea is to capture the registry and the win.ini and the system.ini file before AND after the first local print and compare them to see what got fixed. Then change the script accordingly.
If that doesn't work, the only real short-term solution, considering we're stumped to, it to try to make a BAT file that does what you need.
Once you get that far, we can run the DOS BAT file as a hidden window so no one ever sees it.
Article ID: W13683
Filename: Capturing Printer Port.txt
File Created: 2002:02:12:15:58:12
Last Updated: 2002:02:12:15:58:12