Windows Service Control Functions - 2021/06/21 - beta.1

Post your working scripts, libraries and tools.
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Windows Service Control Functions - 2021/06/21 - beta.1

29 Jul 2020, 10:35

Thanks to user heresy for posting this way back when here.

Functions include:
  • Service_List()
  • Service_Start()
  • Service_Stop()
  • Service_State()
  • Service_Add()
  • Service_Delete()
===========================================================
Updates
===========================================================
ToDo List
===========================================================


:arrow: Download on GitHub
Last edited by TheArkive on 14 Jun 2022, 00:56, edited 15 times in total.
User avatar
TheDewd
Posts: 1510
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Windows Service Control Functions - 2020/07/29 - a119

29 Jul 2020, 10:37

Did you intend to attach your scripts to this post? I don't see it. Thanks!
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Windows Service Control Functions - 2020/10/28 - a122

28 Oct 2020, 08:19

Update 2020/10/28:
  • Fixed up Service_Add() and Service_Delete() (tested and working on my system - make sure you have admin rights!)
  • Added text output option for Service_State(svcName,textOutput := false)
  • Created a better example for looping through the output Map() returned by Service_List()
  • Can't get DllCall("GetServiceKeyName") to work, suggestions welcome. The remnants of my attempts are at the bottom of the script.
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Windows Service Control Functions - 2020/10/28 - a122

12 Mar 2021, 18:07

Update: 2021/03/13
  • updated for a129
  • added some more examples and comments
Planning to add the ability to define "delayed auto start".
ziwzih
Posts: 15
Joined: 21 May 2017, 18:26

Re: Windows Service Control Functions - 2021/06/21 - beta.1

17 Jan 2022, 13:46

This something I've been searching for!!! I am pretty inexperience when it comes to this level of code but I can't seem to get the _Windows_Service_Controls to run. It gives me
Error at line 227.
Line Text: A_LastError
Not allowed as an output variable.
Any tips to get this bad boy up and running? Thanks!
User avatar
TheArkive
Posts: 1027
Joined: 05 Aug 2016, 08:06
Location: The Construct
Contact:

Re: Windows Service Control Functions - 2021/06/21 - beta.1

17 Jan 2022, 14:02

The only way I can replicate your error is to run this script with AutoHotkey v1.1

This lib is for AutoHotkey v2.beta-1+

Other than that, if you use the proper AHK version, just uncomment the examples to see how it works.

Return to “Scripts and Functions (v2)”

Who is online

Users browsing this forum: gongnl, hisrRB57, hoppfrosch and 22 guests