3

I have a .vbs file which I execute using cscript. Now that the script is sable; I want to run in background all the time.

Hence, I want this .vbs file to run as a service.

How do I create (install) it?

vintrojan
  • 1,277
  • 1
  • 12
  • 22

1 Answers1

4

Scripts are usually not prepared to run as a service (they don't provide the interfaces required for managing the service). You're probably better off creating a scheduled task that launches your script at system boot (or at logon).

schtasks /create /sc onstart /tn "name" /tr "cscript.exe C:\path\to\your.vbs" /ru SYSTEM
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328