11-27-2019, 04:58 AM
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
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
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
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
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.
;; ------