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.

Any ideas?

I understand that KACE cannot nest KBOX functions and also doesn't support Windows Environment Variables either.

Answer Summary:
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

2

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.

Answered 06/15/2012 by: chucksteel
Red Belt

  • great stuff, I would have preferred to use the escape the quotes solution, would be nice if they documented this stuff!

    Instead i created a ZIP file containing my scripts and used a scripting task to extract the zip file to C:\Windows\KACE.

    I'll probably re-work this to use the escape quotes solution.
  • Using Agent 5.3.53177 this doesn't work for me, in the debug log I also see it interpretting the "and" in "Documents and Settings" as a LOGICAL AND, so splits it into two rules... this is quite annoying. The workaround in the end by support was to use DOS 8 character representation for the path, so C:\Docume~1\AllUse~1\Dell\KACE\etc lets hope you never have to use a path with "OR" or "AND" in the first 6 characters of a folder name!
Please log in to comment

Answers

This content is currently hidden from public view.
Reason: Removed by user request
For more information, visit our FAQ's.

1

I can make this run on Windows XP by copying the vbscripts to C:\Windows\KACE and then it works perfectly.

The only conclusion I have is that the ShellCommandTextReturn(command) cannot handle spaces in the command and does not respect " " as you would normally use in Windows.

I've now got to work out how to copy these scripts to C:\Windows\KACE with-out flashing up a DOS prompt on everyones computers.

I've never known a product with so many un-documented nuances!

 

Answered 06/14/2012 by: Geedoubleu
Senior Yellow Belt

  • Use http://www.f2ko.de/programs.php?lang=en&pid=b2e to stop the CMD prompt. It has helped me.
  • Excellent tool, thanks for sharing!

    John
Please log in to comment
Answer this question or Comment on this question for clarity
Five Steps for Easier- and More Effective- IT Inventorying
Having an accurate inventory of all your IT assets is critical to ensuring that users are productive and that every dollar is well spent. This white paper outlines five steps that improve inventorying both hardware and software.

Share