Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stopping Windows service
#4
Maybe something like this:
Compile to .exe and then run the compiled executable as administrator.
Make sure you remove the "out _s" line (or you could leave it).

Macro Macro9
Code:
Copy      Help
str cmd_1="taskkill /F /FI ''SERVICES eq wuauserv''"
RunConsole2(ccmd_1 _s) ;; _s contains command line output
out _s

;; From: http://woshub.com/killing-windows-services-that-hang-on-stopping/
;; if success, then output command line output (PID will be different):
;; ......
;; SUCCESS: The process with PID 318 has been terminated.
;; ......

That page http://woshub.com/killing-windows-servic...-stopping/ als has a method described at the top which needs 2 steps.
Step 1: get the PID of wuaserv: sc queryex wuauserv
Step 2: then stop that process ID, for example if the PID you get at step one is 816 then: taskkill /PID 816 /F

I think the method using taskkill /F /FI "SERVICES eq wuauserv" is easier.

Or if you want to use the "net" command (remove "out _s" , compile to .exe then run .exe as admin):

Macro Macro7
Code:
Copy      Help
str cl="net stop wuauserv"
RunConsole2(cl _s) ;; _s contains command line output
out _s

;; If wuaserv was already stopped (not running), then command line output:
;; ------
;; The Windows Update service is not started.
;; ------

;; If wuaserv is running, then command line output:
;; ------
;; The Windows Update service is stopping.
;; The Windows Update service was stopped successfully.
;; ------


Messages In This Thread
Stopping Windows service - by InterestedNewbie - 11-26-2019, 09:04 PM
RE: Stopping Windows service - by r0n - 11-26-2019, 10:33 PM
RE: Stopping Windows service - by r0n - 11-27-2019, 04:58 AM
RE: Stopping Windows service - by Gintaras - 11-27-2019, 06:47 AM
RE: Stopping Windows service - by Gintaras - 11-28-2019, 06:52 AM
RE: Stopping Windows service - by luvu2des - 12-08-2019, 09:19 PM
RE: Stopping Windows service - by luvu2des - 12-09-2019, 01:33 AM
RE: Stopping Windows service - by luvu2des - 12-13-2019, 06:16 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)