How to reload printers in coldfusion without restarting service?
To use a network printer ColdFusion is going to need to be running under a domain account that has permissions to network resources
. The default user that the ColdFusion Windows Service runs under is localSystem
. This user account normally has lots of permissions to the local system but no permissions on the network. The usual solution is to create a domain account for this purpose and then set the ColdFusion Windows service to run as that user in the Services Control Panel.
I recently installed a printer on my server machine, and it was detected right away without any issues.I am using CF10 on a Windows 7 64-bit system. So the following code listed my printer without any restart of the service at all:
<cfdump var="#GetPrinterInfo()#">
Hope this would help.
I have worked with Java and printers and as stated by daveloyall in the comments the problem might come from Java.Tests have shown that when you launch a java application, it takes a snapshot of the current printers list and never updates it so the only way to refresh the printer list is to restart the application.
Yes, a sudo would sort it out...Or, the sysadmin setting the synch to a shorter interval (but that would increase the CPU time allocated).