Scripting Question

Create a label for machines that have a specific folder

07/19/2015 1231 views
Hi guys
I'm trying to create a K1000 label based on pc's that have a certain folder installed on it

the location of the folder is...


(xxx is the user profile name)

any ideas on how to do this with a custom Inventory Rule or...?

The reason being is that the latest java is required for this to work, so I only want to update JAVA on the machines that have this folder on them

regards vince
0 Comments   [ + ] Show comments


All Answers

Custom rules run in the system context so enumerating user folders is better done with a script. If you are updating Java then why not look for the version of Java installed on the machine instead of looking at folders in a user's path?

Answered 07/20/2015 by: chucksteel
Red Belt

  • Or as Chuck says, do it in a script, so sort out the installation and then call it from within a script running only if the directory is found
  • that would have been ideal, however we use the same version of java throughout, but this folder requires the latest java v8.51 to work as it's a web app, whereas all the other machines we use v8.45 and wish to stick to it for now.
    • Just to understand: You have a web application that generates the folder in the user profile and you need to identify machines that are using that web application so that you can upgrade their java version. Is that correct?
      • That is correct
        the folder that is generated in the user profile is what I want to detect so I can update JAVA on that machine. But I want to create a label that has that folder on the machine
This command will find all instances of a folder on the machine:
dir foldername /s /b

You could use ShellCommandTextReturn(cmd.exe /c dir foldername /s /b) as your custom inventory rule and then create a smart label if the results include c:\users.

Answered 07/22/2015 by: chucksteel
Red Belt

This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ