Run a program as a Service


Recommended Posts

How to Run a Program as a System Service!

Step 1 : Download and install srvtools.zip, this can be downloaded from the Microsoft website HERE

Step 2 : Once installed find the two files named as follows : instrv.exe and srvany.exe and copy them to the folder where the exe lies for the program you want to make a service.

Step 3 : Open up the command prompt and type in the following. For the example I'm using a folder called "example" :

cd "C:\example\"

This puts command prompt into the folder where your program lies.

instsrv Servicename"C:\example\srvany.exe"

This installs the program as the service. Yes!

Replace Servicename with your own service name.

Some registry editing to go and then were done.

REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Servicename\Parameters]
"Application"="\"C:\\example\\example.exe\""

Save as a *.reg file and simply double click to run it.

You can also see you need to replace the Servicename and the directory with the service name and your program folder you made earlier.

C & C's welcome.

Edited by Popcorned
Link to comment
https://www.neowin.net/forum/topic/436726-run-a-program-as-a-service/
Share on other sites

Yes, it shows in the service panel so you can also allow it to interact with the desktop. The advantage of this is that the program is going to run on system boot. So if you need a software to run for some reason without stopping this can do it. I don't know exactly why you want to do this, but I think it's helpfull for those times when you might need it.

i found INSTSRV.EXE and SRVANY.EXE here:

http://www.electrasoft.com/srvany/srvany.htm

i put the two files inside the Winpooch folder and created two files:

WP_Service.cmd

instsrv Winpooch "D:\Program Files\Winpooch-0.5.10\srvany.exe"

WP_Service.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Winpooch\Parameters]
"Application"="\"D:\\Program Files\\Winpooch-0.5.10\\Winpooch.exe\""

and ran them in that order. I do have a Winpooch entry in Services.msc and I see it in Autoruns, but it doesnt work when i try to start it. :(

Edited by DigeratiPrime

Might be you don't have it set ti allow to interact with desktop, so you see no windows.

I use this method to run Hamachi all the time from system boot, very handy. I have also set it up to run command prompt, so if I ever need anything, I can get a command prompt running as system, which allows me to reset permissons and stuff, if I ever bork them up. Also, if you want to live really dangerously, you can use this command prompt to run any other app (like IE if you feel brave) as System.

Firstly Hi all...great forums :)

Thanks for the guide but I seem to be having some probs.

I am trying to have Speedfan as a service and just cant seem to get it going.I have followed the instructions given,replacing servicename and directory etc.

Speedfan wont even show up in services.

Any idea what Im doing wrong?

the directory is D:\Program Files\Speedfan and I was going to call the service simply Speedfan.

I began as follows...

cd "D:\Program Files\Speedfan\"

then followed with....

instsrv Speedfan"D:\Program Files\Speedfan\srvany.exe"

with which Ii get this......

Installs and removes system services from NT

INSTSRV <service name> (<exe location> | REMOVE)

[-a <Account Name>] [-p <Account Password>]

Install service example:

INSTSRV MyService C:\MyDir\DiskService.Exe

-OR-

INSTSRV MyService C:\mailsrv\mailsrv.exe -a MYDOMAIN\joebob -p foo

Remove service example:

INSTSRV MyService REMOVE

This is my reg file...

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Speedfan\Parameters]

"Application"="\"D:\\Program Files\\Speedfan\\speedfan.exe\""

Any help much appreciated.

Thanks,

Ray

Man, it's hard to find a error in that but I think I may have got you a answer. Look below.

instsrv Speedfan"D:\Program Files\Speedfan\srvany.exe"

Closely look at this

Speedfan"D:\

You can see there is no space between

fan

and

"D:\

Add a space and you get

instsrv Speedfan "D:\Program Files\Speedfan\srvany.exe"

Should and better work!

Nope, sorry mate. I've downloaded and tried and tested it myself. It's something with the program because i did it with another program just now and everything goes as planned. Sorry :(

  • 2 weeks later...

how does running a program as a service benefit? i am curious and am sure that others are too. also, will it show up in services under admin tools?

See apache, for example...

Its really boring that black screen :p

You run as a service and its one program less on your taskbar lol

This is the benefit I know :p

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • No, "a great deal" for 32GB of DDR5 is $50, not $350. I mean I see what you mean, that it's a decent price compared to what's currently available, but you really should put a disclaimer in this articles explaining that it's still multiple times more expensive than it used to be.
    • Linux 7.1 stable launch looms as Linus Torvalds releases the final release candidate by Paul Hill Linus Torvalds has just released what’s expected to be the final release candidate of Linux 7.1, rc7. The Linux founder said that this RC is not small, but smaller than recent releases, which is a good sign because he expects the stable version to drop next week if things continue on this trajectory. Linux kernels see a merge window for the first two weeks of their life, where developers add new features, then there are about seven or eight weeks of release candidates before the stable version. Typically, there are seven release candidates, but if more time is needed, then an eighth release candidate is released too. This week’s RC’s biggest area of fixes was for GPUs, with networking just behind. Torvalds said that the rest of the release was “pretty random and spread out” with some architecture fixes, driver fixes, filesystem improvements, and build fixes for more unusual configs. In terms of specific pieces of hardware receiving improvements in this update, we had more AMD Zen6 models supported and fixes for AMD SDMA 7.1 and GFX11. Hardware that got improvements includes Lenovo laptops, HONOR laptops, and MSI laptops. Here are the changelogs for those: ASoC: amd: acp: Add DMI quirk for Lenovo Yoga Pro 7 15ASH11 Input: atkbd - add DMI quirk for Lenovo Yoga Air 14 (83QK) Input: atkbd - skip deactivate for HONOR BCC-N's internal keyboard ASoC: amd: yc: Add MSI Raider A18 HX A9WJG to quirk table ASoC: amd: yc: Enable internal mic on MSI Bravo 17 C7VF When the stable Linux 7.1 is released, it will be up to distribution maintainers, such as Canonical and Red Hat, to release the update to their users via the update manager. Some versions of Linux will get it before others, and some will never get it at all. Fedora and Arch-based distros will be among the first to get it, though. If you don’t get it, the security fixes will be backported to your system’s kernel, so you won’t be at risk, but you won’t get newer hardware support, which is fine if your computer works now.
    • Ideally, the algorithm is smart enough to see the real sender ID and non-spoofed address to block it. Ideally.
  • Recent Achievements

    • One Month Later
      DJC50PLUS earned a badge
      One Month Later
    • Week One Done
      DJC50PLUS earned a badge
      Week One Done
    • Proficient
      Eric Biran went up a rank
      Proficient
    • Dedicated
      Conjor earned a badge
      Dedicated
    • Week One Done
      Windows Guy earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      493
    2. 2
      PsYcHoKiLLa
      249
    3. 3
      Steven P.
      71
    4. 4
      ATLien_0
      68
    5. 5
      +Edouard
      68
  • Tell a friend

    Love Neowin? Tell a friend!