Hi

Is it possible to create a custom inventory field which contains the contents of a file?
I have done this with a registry value using - RegistryValueReturn()

Is there a similiar command for text files, the file would only contain a single line of text.

Thanks
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Try this:
ShellCommandTextReturn(cmd.exe /c type C:\yourfile.txt)
Answered 01/04/2012 by: dchristian
Red Belt

Please log in to comment
0
Hi

Thanks for a speedy response. That would work a treat, only I have since realised that the file I wish to see resides in the APPDATA directory of the users directory, and unfortunately the environment variable %username% won't work. Does anyone know a way around the environment variable issue, or when KACE plan to allow the usage of env variables in a custom inventory rule.

Thanks
Answered 01/04/2012 by: PG_t4ttyt3ddy
Senior Yellow Belt

Please log in to comment
0
You could write a script that runs under that user's account (the script has to be an online kscript and run as user logged in to console) and copies the files to another location on the c drive or just upload the file right into kace in the script.
Answered 01/04/2012 by: ms01ak
Tenth Degree Black Belt

Please log in to comment
0
You are correct in saying that Windows environment variables are not supported in custom inventory rules.

However, I find some of them work sometimes anyway.[:)] Sande
Answered 01/08/2012 by: snissen
Fourth Degree Green Belt

Please log in to comment
2
you can find the enviroment variables in here via registry

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

*edit* this is only system enviroment variables, not user, also remember the agent runs as SYSTEM, not the logged on user that could be why it won't return %USERNAME% *edit*
Answered 01/10/2012 by: rmeyer
Second Degree Blue Belt

Please log in to comment
Answer this question or Comment on this question for clarity