Peanutter571
asked on
How to check a service is running then install an executable
Hi this is my first question here and I'm new to VBScript as well, so apologies before hand.
I'm trying to build a VBS logon script that will check to see if a particular service is running (e.g wuauserv), then based on the result true/false either continue with the rest of the script or install an .exe file.
Ideally I would like a message box to be displayed informing the user that the exe is installing and it will take a few minutes to complete.
Currently this is done with a batch similar to the below
ECHO.
ECHO Update
ECHO.
ECHO Installing so and so this might take a few minutes
SC query wuauserv | find "RUNNING"
ECHO.%ERRORLEVEL%
IF NOT ERRORLEVEL=1 goto service_OK
"%logonserver%\netlogon\lo gon\wsus.e xe"
:Service_OK
OS is Windows XP and 7
Any help will be much appreciated.
I'm trying to build a VBS logon script that will check to see if a particular service is running (e.g wuauserv), then based on the result true/false either continue with the rest of the script or install an .exe file.
Ideally I would like a message box to be displayed informing the user that the exe is installing and it will take a few minutes to complete.
Currently this is done with a batch similar to the below
ECHO.
ECHO Update
ECHO.
ECHO Installing so and so this might take a few minutes
SC query wuauserv | find "RUNNING"
ECHO.%ERRORLEVEL%
IF NOT ERRORLEVEL=1 goto service_OK
"%logonserver%\netlogon\lo
:Service_OK
OS is Windows XP and 7
Any help will be much appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes, that would be correct.
ASKER
Open in new window
This would look to see if the service state was not running i.e not installed ?