Using SC.exe for creating the service

Hi alltogether,

I'm using PDFCreator on a Windows Small Business-Server 2003R2 as network Printer. Everything works fine so far, except that I have to logon every time I restart the server to get PDFCreator working. This is quite a problem and so I tried installing PDFCreator as a service.

I first tried using srvany and instsrv as described and it was working in terms of the service (installed correctly in the Reg and was running according to the service-manager). What did not work was the PDFCreator itself. To get printing to work I have to execute PFDCreator.exe (or the Autostart, respectively) to get the printmonitor up and the printing running(which means I have to logon).

I allowed the service to interact with the desktop, tripple checked every path in the Reg and everything else, nothing worked. The service shows as "started" and does start automatically, but the printer just doesn't work and the print-monitor doesn't come up.

Now I tried to use sc.exe which should work also (worked great on my XP Professional machine).


So command is:

sc create "PDFCreator" start= auto binpath= "c:\\Programme\\PDFCreator\\PDFCreator.exe"

You can even add a description by prompting

sc description "PDFCreator" "This service allows offline priniting of PDFs"


Now the service is created and all seems fine, but when I try to start it, the process bar moves until 2/3rds and then there's this error message 1053: The service did not respond to the start or control request in a timely fashion.

Have you any suggestions for this issue?

Otherwise I would state that using sc.exe is better than using srvany and instsrv, because sc.exe is present on nearly any Windows Machine since XP so it requires no installation, and there's no need to change something in the Reg.

I  have to correct my statement that the service was running under Windows XP. 

Correct would be the following: If I start my PC the PDFCreator print-monitor shows (allow service to interact with desktop) and vanishes after some seconds. I thought this is a normal behaviour but it seems that it is not: The Windows-Logs show that the service has a time-out error (3000ms) and is therefore shut-down.

I don't know why this happens.

Does any of you guys has any idea why the service crashes although it's launched poperly?

Hello,
I am testing exactly the same thing(matter) as you.
A priori it would maybe be necessary to create a project of service via
Visual Basic .NET Microsoft
I test it and inform you.

Cordially

 I found a more likely track(runway), I restore you information tomorrow if my test decisive sound, Good evening!

 I finally succeeded has to start the PDFCreator service: Service: Path to executable: C:\\Program Files\\PDFCreator\\srvany.exe Register: ImagePath: C:\\Program Files\\PDFCreator\\srvany.exe

Parameters:

Application:

C:\\Program Files\\PDFCreator\\pdfcreator.exe

The service starts normally, but I was not able to tested by restarting the waiter(server) for the moment. See U

Here we are, the solution is functional!!!

Reminder of parametrizes:

Service:
Path to executable:
C:\Program Files\PDFCreator\srvany.exe

Register:
ImagePath:
C:\Program Files\PDFCreator\srvany.exe
Paramèters:
Application:
C:\Program Files\PDFCreator\pdfcreator.exe

The last thing that I changed: The account of launch of the service:
Indeed the local account system had no right to write in the directories of automatic recording.
I have now an error 480 when I open the options on the waiter(server), But the rest is functional

I spent part of my afternoon getting this setup. My situation is a bit different as I'm using Server08 x64.

Here is what I did:

Since Server08 does not have the srvany.exe I followed these instructions: http://social.technet.microsoft.com/Forums/en-US/winserverMigration/thread/98a97aee-c62b-4683-94ab-3777899cf7de

I next created an AD user call 'PDFCreator' and made it a member of the Domain Guests group only (make sure you set the password to not expire!).

Next I set the new service to run as the 'PDFCreator' user.

Then, using ShellRunas (http://technet.microsoft.com/en-us/sysinternals/cc300361.aspx) I ran PDFCreator to setup the autosave directory and other options. Make sure you do this as the user you defined in the service setup, trying to load an .ini with the command line switch does not seem to work and the service would load with PDFCreator's default settings otherwise. Also make sure that user has write privs for the PDFCreator program directory and the network share your autosaves are placed in (if using a network share).

Hope this helps fill in the gaps!


Chris Pendergast
Sys Admin - Upper Midwest Aerospace Consortium

 

Ha! Does work! Cool! Thanks guys.. The Thing with the user did the trick, as the service is "per se" startet on the machine-account, which has no settings for the pdf-creator Auto-Save

So let me put this together:

First part from Don_sati:


sc create "PDFCreator" start= auto binpath= "c:\\Program Files\\PDFCreator\\srvany.exe"


 

You can even add a description by prompting

 


sc description "PDFCreator" "This service allows offline priniting of PDFs"


Then add the following key to your registry. You can do that easily by copy & pasting the following text into a *.txt-file and change the file ext to .reg. Double click on it - add to registry. Finished:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\PDFCreator\\Parameters]
"Application"="C:\\\\Program Files\\\\PDFCreator\\\\PDFCreator.exe"

 


Done. Now you have to configure the service to run as an other user.

Open \\Management\\Services\\PDFCreator. Go to the second register(Login) and change the "Login as" from the local system account to another account. The important thing is, that the account has to have write access to the Autosave-Folder.

However, I am not sure that you have to execute PDFCreator as this user for setting up the autosave etc as zetarhopike states.

In my opinion the settings for PDFCreator are stored in the reg-key


[HKEY_LOCAL_MACHINE\\SOFTWARE\\PDFCreator\\Program]


and in my case it worked also with a user which has never started PDFCreator and made any settings.

But keep in mind that I'm talking of Windows SBS 2003R2 x86 and his guidelines are for Server 2008 x64.

Hi all!

Thanks a lot for your help on this topic.

I've installed PDFCreator as a service using these instructions.

Everything works fine except that when i logout of the session the service stops, and the next time i login it goes up again.

Can anyone give-me a help on this?

Thanks a lot in advance.

David

 

** deleted due to spam **

 
Hey, 
 
I have just wanted to announce an achieved installation to us. 
I follow pass on a server under W2k8 R2 (therefore x64) 
I've achieved to put PDFCreator as service without problem. 
Printer pdf is deployed to all desktop UC via GPO.
 
Thanks to The creators, it's a pure happiness. 
If I can help somehow, having said it me! 
 
a filled up user!
 

Sorry for English, I'm French... 

Hi,

I am trying to install PDFCreator on a Win 2008 64bit server,

  1. instsrv PDFCreator c:\THP\srvany.exe

  2. regedit: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PDFCreator\Parameters
    Application:C:\Program Files (x86)\PDFCreator\PDFCreator.exe

the service is starting and ending immediately

it seems to be a problem on an interactive service

does anyone has a workaround

 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\PDFCreator\\

ImagePath : C:\\Program Files (x86)\\PDFCreator\\srvany.exe

it's works ;)

Now who is crazy?

You are.   haha.   

Let me caveat that by saying that i'm completely assuming that you are running a 64-bit OS, be that 2003 or 2008 Server.

You copied a 32-bit executable into c:\\windows\\system32  which is one of the few folders that windows actually cares about when it comes to 32/64 bit executables.   

Its making it easier on you, by allowing you to copy and even do a DIR to c:\\windows\\system32, but in reality,  the srvany.exe is ACTUALLY located in c:\\windows\\SysWOW64

Its that whole masking that happens to allow 32-bit binaries to be executed in a 64-bit system, it 'knows' and will show you what you wanted to see.    What is also happening is that you're executing a 32-bit INSTSRV.exe and it will NOT see the file in c:\\windows\\system32.

Change your command to this, and it'll be good.

instsrv PDFCreator c:\\windows\\syswow64\\srvany.exe

or,  put srvany.exe in ANY other folder that you created yourself and change the path accordingly without having to worry about this 32/64 trickery.

If you are not using a 64-bit OS,  then its definately odd,  otherwise hopefully this helps!!

Brian / ChevyNovaLN

 

 

Using info supplied above, here is my success on Windows Server 2008 R2 (x64)

  • Logon as the local administrator
  • open a command prompt and execute CHANGE USER /INSTALL
  • Installed PDF Creator 0.9.9
  • at still open command prompt, execute CHANGE USER /EXECUTE
  • Start -> Run -> REGEDIT
  • navigate to HKCU\\Software\\PDFCreator\\Program
  • edit value PrinterTemppath and set to: C:\\Program Files (x86)\\PDFCreator\\TEMP
  • create C:\\Program Files (x86)\\PDFCreator\\TEMP and set security so local USERS group has MODIFY rights
  • source previously mentioned SRVANY.EXE file and place in C:\\Program Files (x86)\\PDFCreator
  • open command prompt and execute SC CREATE "PDFCreator" START= AUTO BINPATH= "C:\\PROGRAM FILES (x86)\\PDFCreator\\SRVANY.EXE"    (note the whitespace after the equal signs)
  • After this, I finish fluffing the server and then copy the user profile over the default so that following logons see the box how I wanted them to see it setup.
  • ta-da!

 

 

*deleted due to spamming

What do you think of this:

c:\\Windows\\System32>instsrv PDFCreator c:\\windows\\system32\\srvany.exe

Unable to find the file at the given path.

c:\\Windows\\System32>dir c:\\windows\\system32\\srvany.exe
 Het volume in station C heeft geen naam.
 Het volumenummer is 1CC4-31BD

 Map van c:\\windows\\system32

14-05-1997  23:49            13.312 srvany.exe
               1 bestand(en)           13.312 bytes
               0 map(pen)  115.899.338.752 bytes beschikbaar

c:\\Windows\\System32>

Now who is crazy?

 

One of our customers runs PDFCreator as a Windows Service with our commercial utility, AlwaysUp. She suggested that we create a step by step tutorial to guide others, so here it is:

http://www.coretechnologies.com/products/AlwaysUp/Apps/RunPDFCreatorAsAService.html

 

Whichever tool you use, be sure to configure PDFCreator to run unattended in the background! Don't forget to disable all confirmations, deactivate the checks for updates and avoid anything that can interrupt the action.

I've just created a blog post that addresses this issue and describes the process of installing PDF Creator on a print server (64bit) and getting it to run as a service,

hopefully this will help:

http://yellowtriangle.wordpress.com/2012/07/02/using-pdf-creator-deployed-from-a-64bit-print-server/

Excellent help provided here which enabled me to get the service running on windows 8.  It creates the auto pdf but does not open on the client.  Is this the expected behavior?