(imported topic written by tomfranken)
I’m looking for all the Java.exe files on servers. The following code works well until I get a random illegal file name:
q: ("]",computer name,pathnames of it,(if (exists version of it) then (version of it as string) else (“Unknown version”))) of descendants whose (name of it as lowercase contains “java.exe”) of folders “\Program files\Java” of drives whose (type of it = “DRIVE_FIXED” AND name of it = “C:”)
A:], , C:\Program files\Java\jre6\bin\java.exe, 6.0.450.6
A:], , C:\Program files\Java\jre7\bin\java.exe, 7.0.210.11
T:383.060 ms
q: ("]",computer name,pathnames of it,(if (exists version of it) then (version of it as string) else (“Unknown version”))) of descendants whose (name of it as lowercase contains “java.exe”) of folders “\Users” of drives whose (type of it = “DRIVE_FIXED” AND name of it = “C:”)
E:The expression could not be evaluated: class IllegalFileName
In use, I won’t restrict to “C:” and I’ll start at folder “” but this quickly throws the error. I could skip the “Users” folder on this server but I don’t know what problem the next server may have. In scripting, we generally have an “On error continue” type command. How can I continue on an error? I also don’t know what other error I may have in a folder or filename so I don’t want to write a bunch of “if not this error and if not that error…” statements for every conceivable error.