Need Script to read name of text file and report back in KBox
I need to be able to read the name of a text file located in a directory off of the C drive. The background is, we identify our computer images by the name of a text file located in C:\image\c21.txt. I would like to read this file name and build a report in Kace to determine which machine has what image.
Thanks!
Thanks!
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
jkatkace
14 years ago
Create a custom field, per this video:
http://www.youtube.com/watch?v=64wrlB34dJU
The function you want to use in your field is the "ShellCommandTextReturn()" function. Load it with a shell command that types out the value of that file...probably "type C:\image\c21.txt" will work.
http://www.youtube.com/watch?v=64wrlB34dJU
The function you want to use in your field is the "ShellCommandTextReturn()" function. Load it with a shell command that types out the value of that file...probably "type C:\image\c21.txt" will work.
Posted by:
GillySpy
14 years ago
JK's technique should be used most of the time.
For advanced users:
For complex shell commands or, more likely, one-time only commands (e.g. based on temporary information you want to track permanently) you can run something to get your data into the registry and then report from there. E.g. if the file c:\image\c21.txt was a temporary file
http://www.kace.com/support/customer/faq/index.php?action=artikel&cat=5&id=968&artlang=en
For advanced users:
For complex shell commands or, more likely, one-time only commands (e.g. based on temporary information you want to track permanently) you can run something to get your data into the registry and then report from there. E.g. if the file c:\image\c21.txt was a temporary file
http://www.kace.com/support/customer/faq/index.php?action=artikel&cat=5&id=968&artlang=en
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.