Jump to content

Start as service


 Share

Recommended Posts

Hi, I have create some autoit script that controlls my irc channel.

I wanna install it as service (my friend has a server :lmao:).

So it is always active.. How i add some program too the service list?

If you dont understand my bad english , i wanna add my script in this list :

These Windows 2000 services are started:


   Automatic Updates
   COM+ Event System
   Computer Browser
   DHCP Client
   Distributed Link Tracking Client
   DNS Client
   Event Log
   iPod Service
   IPSEC Policy Agent
   Logical Disk Manager
   Messenger
   Network Connections
   Plug and Play
   Print Spooler
   Protected Storage
   Remote Access Connection Manager
   Remote Procedure Call (RPC)
   Remote Registry Service
   Removable Storage
   RunAs Service
   Security Accounts Manager
   Server
   Sygate Personal Firewall Pro
   System Event Notification
   Task Scheduler
   TCP/IP NetBIOS Helper Service
   Telephony
   Windows Management Instrumentation
   Windows Management Instrumentation Driver Extensions
   WMDM PMSP Service
   Workstation

The command completed successfully.

By this :ph34r:

-jaenster

Link to comment
Share on other sites

yeah i al ready found it.. But it dont work -.- It dont start correctie.. always i get a error :|

Which option does not work and what is the error. We need info if we are to help.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Creeping, that does not work any easier than the one I posted which also uses srvany. How is this code

#include "ServiceControl.au3"
$servicename = "MyServiceName"
_CreateService("", $servicename, "My AutoIt Script", "C:\Path_to_srvany.exe", "LocalSystem", "", 0x110)
RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\" & $servicename & "\Parameters", "Application", "REG_SZ", @ScriptFullPath)

Secondly, the code I have does not require the additional instsrv.exe.

jaenster, double-click on the service name and see where the "path to executable" is pointing.

Edited by this-is-me
Who else would I be?
Link to comment
Share on other sites

Posted Image

Maby this will help?

This happen if i start my servisch

Did you download Microsoft's Srvany? Because that looks to me like you have just tried to add your exe directly as a service.

You need to use Srvany or one of the other service programs to give the correct reply back to windows

*edit*

These are the instructions for adding a service using srvany

1. Download the SRVANY.ZIP file from http://www.tacktech.com/display.cfm?ttid=197, this contains the program material to set up dummy services on NT (as well as a help file).

2. Install a new dummy service with the following command (from DOS prompt) - INSTSRV TestService C:\SRVANY.EXE

3. You have now installed the new service - we just need to point it to our own application file. To do this we need to amend some registry entries (remember to backup your registry if you're nervous about this bit).

The relevant entries will be under HKEY_LOCAL_MACHINE\system\CurrentControlSet\Services\Testservice.

Amend the DisplayName parameter to some value which identifies your application, it's this value that you'll see in the Control Panel Services applet.

Next create a new key Parameters under the TestService key.

Now create a new string value Application under the TestService key and put the full path and application name in this value (Mandatory).

If your application requires command line parameters then create a new string value AppParameters under the TestService key and put your command line switches / settings in this value (Optional).

If your application requires a working directory then create a new string value AppDirectory under the TestService key and put the directory path in this value (Optional).

4. To start our new application we need only set up the service in the Control Panel Services applet. Find and highlight your new service (will still be called TestService until you reboot) then set its startup settings via the StartUp button, you need to think about the user which should run the service (whether it should be the system admin or a normal user account) and whether the service is to be started automatically or manually.

5. You can start or stop your new service by using the Start / Stop buttons in the Control Panel Services applet.

Edited by ChrisL
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...