Kaseya Community

Help with Check if Java Update Needed Script

This question has suggested answer(s)

Hey guys,

Here's what I've got so far. javaversion.bat contains:
wmic product where "name LIKE '%%java%%'" get * /format:textvaluelist > C:\kworking\javaversion.txt

Step 2 is executing it with the Execute File command, "Wait for the program to complete before continuing" is checked.

Then I use the IF Test File > Contains step, telling it to look for *Update 30* in javaversion.txt, if it finds it, the script should result with a purposed FAIL step. The Else toggle will of course follow with a silent install of the latest java.

However, the IF Test file > Contains is not working for me, because the script keeps returning SUCCESS when Update 30 is clearly written all over the place in C:\kworking\javaversion.txt

What am I doing wrong?


[edited by: aabbasi at 11:30 AM (GMT -8) on 1-24-2012] img typo
All Replies
  • hi aabbasi,

    I understand why you have written the batch file and pushed down so that you can run the bat file and wait for finished executing before running. I don't think it working that way though. If you run the if file test by itself with a pre generated txt output does your if test work.

    If so then its just that the bat file takes a while to get output and kaseya is not waiting for it to finish. So instead swap it out for a run shell command and then pause procedure for 30 seconds or so.

    I think kaseya does not wait for .bat files to finish executing as cmd.exe finishes executing once it opens the command shell and that triggers kaseya to continue. I know is a little stink but thats the way it is.