Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: adding a printer port
The port I want to add is just a local file port, that will print to the file c:\temp\temp.txt using the Generic/Text Only printer driver...any ideas? I am running Windows NT4 Service Pack 5, Winbatch 99k.
We're on NT and nothing in win.ini at all unfortunately. I can see the registry changes that are being made, and can also capture them into a repackage using SMS. However, when I actually run the repackage on a fresh workstation, it makes the registry changes but the printer never actually shows up even after starting/stopping the spooler service. I was just curious if there were any built in functions inside of WinBatch for adding a printer port...I figured I would have better luck with that instead of hacking the registry apart myself =)
You can then use the standard pAddPrinter() function to add a Generic / Text Only printer to the workstation.
:AddPort Message("Notice", "Adding Port To Workstation") ParameterLine = strcat("/c echo ", Password, "| c:\winnt\system32\su.exe ", UserName) ParameterLIne = strcat(ParameterLine,' "net stop spooler"') RunShell("c:\winnt\system32\cmd.exe",ParameterLine,"c:\",@HIDDEN,@WAIT) regkey=RegCreateKey(@REGMACHINE, "Software\Microsoft\Windows NT\CurrentVersion\Ports") RegSetValue(regkey, "[c:\temp\eform.prn]", "") RegCloseKey(regkey) ParameterLine = strcat("/c echo ", Password, "| c:\winnt\system32\su.exe ", UserName) ParameterLIne = strcat(ParameterLine,' "net start spooler"') RunShell("c:\winnt\system32\cmd.exe",ParameterLine,"c:\",@HIDDEN,@WAIT) return
Article ID: W15673
File Created: 2003:05:13:11:29:26
Last Updated: 2003:05:13:11:29:26