Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: printer print
or it can done via the registry.
Get the SYSDIFF utility (check your NT directory you might have it) otherwise snag it from www.microsoft.com and make the "before" file.
Figure out what it did to the registry and re-create it via WinBatch.
;;32 bit Devmode.wbt DMC=27 DaDll=Strcat(DirWindows(1),"USER32.DLL") DllCall( DaDll, long:"SendMessageA", long:-1, long:DMC, long:0, lpstr:newdevice)
Once you've changed the device, you can broadcast a WM_WININICHANGE message to all interested parties in the system to make the printer changes in the registry take effect, so that applications (such as Program Manager, Task Manager, Control Panel, and so forth) can perform an update. An WININICHANGE message (=26) is required for some cases, so it probably would not hurt to do both of them (the WININICHANGE and the DEVMODECHANGE).
The WININICHG is for telling running applications that WIN.INI has changed. Newly run applications will pick up the environment automatically, done as follows:
WININICHG=26 DaDll=Strcat(DirWindows(1),"USER32.DLL") DllCall( DaDll, long:"SendMessageA", long:-1, long:WININICHG, long:0, lpstr:newdevice)Also See (and understand):
Changing Windows 95 and NT Default Printer
Article ID: W13689
Filename: Create but Not Add Printer in WinNT.txt
File Created: 2017:08:29:11:58:50
Last Updated: 2017:08:29:11:58:50