KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Making printers available for printing from a Windows Service
PRODUCT: 4D | VERSION: 13.2 | PLATFORM: Mac & Win
Published On: December 20, 2012

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 .
echo 3 text files have been created in C:\
echo .
echo You now to edit the 3 text files to replace:-
echo HKEY_CURRENT_USER\ with HKEY_USERS\.Default\
echo .
echo Once the text files have been changed....
pause
reg import C:\PrinterPorts.txt
reg import C:\devices.txt
reg import C:\Windows.txt
echo .
echo Done
echo .
pause


  1. Copy the text above and paste it into a text file on the Windows machine you want to perform this on.

  2. Rename the text file to have a .bat file extension

  3. Execute the bat file

  4. When prompted; edit the 3 text files to replace:-
    HKEY_CURRENT_USER\ with HKEY_USERS\.Default\

  5. 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