-
1. Re: Not identify network printer when JBoss start as windows
peterj Sep 27, 2007 12:28 PM (in response to harshi2003)Under which account is the service running? If it is running under the System account, you should try setting the service to run as another account ( I usually set up a specific account for the service). And then make sure that if you log in as that account that you have access to that printer, and that the account has the default printer set. If you do, then the printing should work.
-
2. Re: Not identify network printer when JBoss start as windows
harshi2003 Sep 27, 2007 11:17 PM (in response to harshi2003)Thanks Peter.
Actually the Service running under the system account. I have set up an account for the service. this account has administrative priviledges. now the application identifies the printer. since i have created a bat file and execute now it doesn't print because the user account doesnot have priviledges to the killing of the process.
please find the code attached
FileWriter fw =new FileWriter(PDFPath+"printPDF.bat");
PrintWriter out = new PrintWriter(fw);
out.println("taskkill/IM AcroRd32.exe /t");
out.println("CALL START /MIN AcroRd32.exe /h /p "+PDFPath+filename);
out.close();
fw.close();
String batPath = PDFPath + "printPDF.bat";
tr = Runtime.getRuntime();
Process p = tr.exec(batPath);
any ideas.
Thanks in adavance -
3. Re: Not identify network printer when JBoss start as windows
peterj Sep 28, 2007 11:11 AM (in response to harshi2003)Login with the account the service is running in, and enter the commands by hand. If that will not work, it will not work from the service. If it does work, it should work from the service, because things like this should depend only on the account permissions.
Also, check your syntax, I think you need a space between "taskkill" and "/IM". -
4. Re: Not identify network printer when JBoss start as windows
harshi2003 Sep 29, 2007 12:52 PM (in response to harshi2003)Thanks. Yes it works when i create and register the service with a user account which has doman access. further i use Run as command to specify the user and kill the task.
Thanks again