In order to make printers available to the Local System Account, so that the printers can be used by 4D Server when the application is running as a Service, it is important to make sure that those printers are installed and available to that account.
The following windows script (.bat file) can be used for making the printers available to the current user also available to the Local System Account:
|@echo off |
reg export "HKCU\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts" C:\PrinterPorts.txt /y
reg export "HKCU\Software\Microsoft\Windows NT\CurrentVersion\devices" C:\devices.txt /y
reg export "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows" C:\Windows.txt /y
echo 3 text files have been created in C:\
echo You now to edit the 3 text files to replace:-
echo HKEY_CURRENT_USER\ with HKEY_USERS\.Default\
echo Once the text files have been changed....
reg import C:\PrinterPorts.txt
reg import C:\devices.txt
reg import C:\Windows.txt
- Copy the text above and paste it into a text file on the Windows machine you want to perform this on.
- Rename the text file to have a .bat file extension
- Execute the bat file
- When prompted; edit the 3 text files to replace:-
HKEY_CURRENT_USER\ with HKEY_USERS\.Default\
- After editing the files and saving them go back to the DOS window and press a button to allow the script to complete executing
This was referenced in the the 4D_Tech (iNUG) post here: http://4d.1045681.n5.nabble.com/Printing-from-4D-Server-running-as-a-Service-was-Win2PDF-and-4D-Server-as-a-Service-td5541411.html