written by biggyfix9
Hi All
I would like to disable JQS service as I deem it pretty useless unless you rely JAVA all the time. . I’d like to stop it then disable it.
sc config javaquickstarterservice start= disabled
sc stop javaquickstarterservice
I can do this on the cmd line but how can I get this in a Big Fix script?
The relevance I guess should target only computers that are running the JQS service, but again I am not sure how to write this?
Any help appreciated!
Colin
(imported comment written by SystemAdmin)
Use the relevance:
name of operating system as lowercase starts with “win” AND state of it = “Running” or start type of it != “disabled”) of service “JavaQuickStarterService”
Action should look like this:
waithidden sc config JavaQuickStarterService start= disabled
waithidden net stop JavaQuickStarterService
(imported comment written by biggyfix91)
thanks for the reply
I am getting this when putting it into the relevance debugger
q: name of operating system as lowercase starts with “win” AND state of it = “Running” or start type of it != “disabled” of service “JavaQuickStarterService”
E: “It” used outside of “whose” clause.
When I deploy the fixlet its going not relevant even though the service is running. hmmmmm
(imported comment written by SystemAdmin)
I’d add a check to the relevance Brian proposed, in case the service does not exist (prevent the script from becoming relevant on systems that don’t have the service).
name of operating system as lowercase starts with “win” AND (exist service “JavaQuickStarterService” AND start type of service “JavaQuickStarterService” != “disabled”)
Not sure how you would use the “it” relevance - but I’m sure it could be done.
You can also use
waithidden cmd /c sc stop “JavaQuickStarterService”
in place of the net stop. Again, not sure if their is a benefit to either and you probably don’t need the cmd /c so it would look like this
waithidden sc stop “JavaQuickStarterService”
Perhaps Ben can comment on the “best” method, but any of the suggestions will get the job done.
(imported comment written by biggyfix91)
q: name of operating system as lowercase starts with “win” - it works if I just use this relevance. Just need to figure out the wording to include only the machines with the service running.
Thanks again
(imported comment written by SystemAdmin)
Sorry! I left out a “(” before “state of it”. I’m using the it there to check both the running state and that it is disabled without having to reference the service name twice. Good call on doing a check to see if the service is there-- I adapted it from checking for a service that was always there so I didn’t have that in there. Try this instead:
name of operating system as lowercase starts with “win” AND exists service “JavaQuickStarterService” whose (state of it = “Running” OR start type of it != “disabled”)
That should check to see if the service exists first and then whether it is running OR not disabled.
(imported comment written by biggyfix91)
thanks all.