Custom Inventory - ShellCommandTextReturn does not work
Ok, I have created some vbscripts to search for file types PST, MDB & XLA files which report back as a String, the file paths, names and sizes. The script works perfectly.
So I distrbuted the scripts using KACE Scripting feature and have the folder numbers used in the KBOX cache stored in the All User/ProgramData folders.
I have then added the Software with custom inventory rules as below:-
ShellCommandTextReturn(cscript.exe /nologo "C:\Documents and Settings\All Users\Dell\KACE\kbots_cache\packages\kbots\137\FindMDBFiles.vbs")
This DOES NOT WORK! The same command editing for Windows 7 profile structure works perferctly as below:-
ShellCommandTextReturn(cscript.exe /nologo "C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\137\FindMDBFiles.vbs")
The only difference is spaces in the folder structure.
I understand that KACE cannot nest KBOX functions and also doesn't support Windows Environment Variables either.
Community Chosen Answer
You have to escape the quotes with a backslash:
ShellCommandTextReturn(cscript.exe /nologo \"C:\Documents and Settings\All Users\Dell\KACE\kbots_cache\packages\kbots\137\FindMDBFiles.vbs\")
Support gave me this solution when I submitted a ticket for a similar issue.