Gå til innhold
Trenger du hjelp med PCen? Still spørsmål her! ×

Autostart av program


Anbefalte innlegg

Videoannonse
Annonse
  • 1 måned senere...

Jeg har lett etter noe lignende, altså å kunne kjøre et program som en tjeneste i windows, men kom bare over programmer som koster penger.

 

Det måtte da være mulig å gjøre dette uten å betale for et ekstraprogram...? :p Etter litt søking her på forumet kom jeg fram til en tråd fra 2003 med en fiffig link:

 

http://www.haxial.com/faq/auto-startup/mswinservice/

 

Fremgangsmåten: (i tilfelle siden blir flyttet eller fjernet)

gjelder her for KDX Server, men burde fungere med ennhver exe-fil

Klikk for å se/fjerne innholdet nedenfor
Using SRVANY to run as a Service

 

To install KDX Server as a Windows Service using Srvany and Instsrv, follow the steps below:

 

1. Obtain the Srvany.exe and Instsrv.exe programs from the Windows NT Resource Kit, or download here. Alternatively, you can download Srvany.exe from Microsoft at the following location, but note that it is a self-extracting archive, so you need to run it to obtain the real Srvany.exe file.

 

ftp://ftp.microsoft.com/bussys/winnt/winn.../srvany_x86.exe

 

2. For this example, we will assume your KDX server is located at "C:\Program Files\KDX Server\KDXServer.exe". However, there is no problem with having yours in a completely different location. Simply replace the applicable locations we use in this tutorial with wherever your server is located.

 

3. Place a copy of both "Srvany.exe" and "Instsrv.exe" into your KDX Server folder ("C:\Program Files\KDX Server\"). It is also valid to place these executables into your Windows folder, but for simplicity purposes, we are going to both assume and suggest you simply place them into the same folder as your KDXServer.exe.

 

4. Open a command prompt (click the Start menu, choose Programs, then Accessories, then MS-DOS Prompt. OR Start menu, choose Run, type "command", and click OK). In the command prompt window, type these commands INCLUDING the quotes:

 

cd "C:\Program Files\KDX Server\"

(But replace the location with the actual location of your KDX Server folder.)

 

instsrv KDXServer "C:\Program Files\KDX Server\srvany.exe"

(But replace "C:\Program Files\KDX Server\srvany.exe" with the actual location of your srvany.exe)

 

5. Run regedit.exe (click the Start Menu, choose Run, then type "regedit", and click OK) and browse to:

 

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\KDXServer

 

This "Key" (as it is called in the registry) was created by Instsrv when you executed that previous command; This is what Instsrv does for is. Without it, we would have had to create all of these Keys and Values ourselves.

 

WARNING: Using RegEdit incorrectly can cause serious problems that may require you to reinstall your operating system. Use it at your own risk.

 

6. Second-click on the "KDXServer" key and click New -> Key. This will create a new sub-key under that key; Name it "Parameters" (without quotes).

 

7. Second-click on the "Parameters" key and click New -> String Value. This will create a new "Value" inside of that key; Name it "Application" (without quotes).

 

8. Double-click the Value for "Application" and enter the location of your KDXServer.exe -- for our tutorial we will enter "C:\Program Files\KDX Server\KDXServer.exe" (without quotes).

 

9. Now, open your Services control panel (located in the Administrative Tools folder) and look for your newly created KDXServer service. Each individual service can be set to start up in a different manner. Second-click on the new service and click on "Properties" and you will see a dropdown list labeled "Startup Type" amongst other things. The 3 different settings are:

 

* Automatic -- The service will start automatically whenever the computer boots up regardless of whether anyone logs into the computer.

* Manual -- The service will NOT start automatically. Any Administrator may start the service from this control panel, and it will remain running even after they log off, but will not start automatically.

* Disabled -- The service will NOT start automatically and may NEVER start, that is, unless someone changes this setting back to one of the other two.

 

10. You may now close the properties window, and unless you set your service to "Disabled" (which would be silly, after all, KDX is great) you may now second-click on it and click "Start".

 

11. You can now log off and attempt to connect to your server from another computer, and it should work.

 

Har testet fremgangsmåten som står der og det funker som bare rakkern. Mulig de andre programmene som gjør det samme (som koster) har flere funksjoner og GUI, men dette holder plenty - hvertfall for meg. Kanskje også for gogon...?

 

 

-P

Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
  • Hvem er aktive   0 medlemmer

    • Ingen innloggede medlemmer aktive
×
×
  • Opprett ny...