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

    • Feels like Hitman in Bond skin. But overall a great game! 👍
    • Microsoft released new Defender update for Windows 11, 10, Server ISO installations by Sayan Sen Microsoft releases new Windows Defender update packages very frequently to protect against various newly discovered malware. Once a while every three months or so, the company also pushes out these updates to Windows images (WIM and VHD) and ISOs, that are used to install Windows. Hence with the newest Windows 11 update available via the official MCT tool, you should get these definitions. This update package is necessary as a Windows installation image may contain old, outdated anti-malware definitions and software binaries. Aside from better security, these updates can also provide improved performance benefits in some cases. When a new Windows installation is set up, there may be a temporary security risk due to outdated Microsoft Defender protection in the OS installation images. This happens because the antimalware software included in these images might not be up to date. Thus Microsoft says that these updated definitions essentially help close this protection gap. Microsoft delivered the latest security definitions for Windows images via security intelligence update version 1.445.323.0. The Defender package version is also the same. It applies to Windows 11, Windows 10 ESU, Windows 10 Enterprise LTSC 2021, Win 10 Ent LTSC 2019, Win 10 Ent LTSB 2016, Windows Server 2022, Windows Server 2019, and Windows Server 2016. Microsoft writes: "This package updates the anti-malware client, anti-malware engine, and signature versions in the OS installation images to following versions: Platform version: 4.18.26040.7 Engine version: 1.1.26040.8 Security intelligence version: 1.447.236.0" From Microsoft's security bulletin, we learn that the security intelligence update version 1.447.236.0 was released early last month and adds threat detections for various malware like trojan, backdoor exploits, ransomware, stealers, AutoKMS, and more. For those wondering, the latest intelligence update is version 1.451.297.0 at the time of writing.
    • Hello, Hope all is well. I am in UK.  
  • Recent Achievements

    • Dedicated
      Mark Spruce earned a badge
      Dedicated
    • Collaborator
      conkir earned a badge
      Collaborator
    • Rising Star
      olavinto went up a rank
      Rising Star
    • One Month Later
      lamborghiniv10 earned a badge
      One Month Later
    • Week One Done
      lamborghiniv10 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      504
    2. 2
      PsYcHoKiLLa
      271
    3. 3
      Skyfrog
      74
    4. 4
      +Edouard
      73
    5. 5
      Steven P.
      71
  • Tell a friend

    Love Neowin? Tell a friend!