Jump to content
Sign in to follow this  
Ghastly_MIB

Run as System with sc.exe

Recommended Posts

Ghastly_MIB

Hello all,

I'm trying to install an autoitscrip executable as an service.

The current install line i'm using would be:

Run(@ComSpec & " /c " & "sc create MyService binpath= """ & @ScriptFullPath & " /start"" type= share type= interact start= auto", "", @SW_HIDE)

When i'm trying to start the service, it would be visible in my systemtray.

But in the services list the status is "Starting..." (dutch OS, so it's a guess).

And after 30 seconds, the program closes. The windows log says that the program did not responsed.

Is there a way to fix this?

Thanks,

Mathijs

Edited by Ghastly_MIB

Share this post


Link to post
Share on other sites
Jos

shouldn't this part :

binpath= """ & @ScriptFullPath & " /start""

be:

binpath= """ & @ScriptFullPath & """ /start

And you have twice a "Type=". shouldn;t that be one of the 2 ?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Ghastly_MIB

Hey,

the /start command line would be used for the command line for the autoit script.

Example: C:\test.exe /start

And the type must be added twice:

More info: http://support.microsoft.com/kb/251192/en

It installs succesfull, but the services think that the program does not work, and shutdown the application after 30 seconds. (timeout). The program work without any problem in that 30 seconds. But that it closes.

Share this post


Link to post
Share on other sites
arcker

already discussed

for running an exe as service, it must fill some contraints to run.

you can'to do this with autoit exe.

but you can use srvany.exe. it will do the job well.


-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]

Share this post


Link to post
Share on other sites
Ghastly_MIB

Thanks, i'm going to try that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×