Scripting Question

K1000 Custom Inventory Rule that reports back shortcut syntax

02/06/2015 2003 views
We have several clients that have a server based application and it is unique based on their location.  I need to create a report or a custom inventory rule that will report back the syntax for the shortcut on each.  Is there a way to accomplish this?  They are all running Windows 7 x86 machines.  We are running Version: 6.2.109330 K1000 and the shortcut is located in the C:\Users\Public Desktop location.
Answer Summary:
0 Comments   [ + ] Show comments


All Answers

You want to do this as a 2 step approach

1 Create a kscript to run a vb script  that creates a text file
2 Create a CIR to read the text file

for this I am using Autocad 2105 shortcut

Create this code as a vbscript replacing the name of the shortcut with yours.
Set Shell = CreateObject("WScript.Shell")
DesktopPath = "c:\users\public\Desktop"
Set link = Shell.CreateShortcut(DesktopPath & "\AutoCAD 2015 - English.lnk")
wscript.echo link.TargetPath
wscript.echo link.Arguments
Create a batch file to call the vbscript to file
c:\windows\system32\cscript  /nologo link.vbs > C:\ProgramData\Dell\KACE\user\autocadshortcut.txt
Create a kscript upload the files as a dependency

The text file will look like this:
C:\Program Files\Autodesk\AutoCAD 2015\acad.exe
/product ACAD /language "en-US"

Create a CIR
ShellCommandTextReturn(cmd /c type c:\programdata\dell\kace\user\autocadshortcut.txt )

Answered 02/06/2015 by: SMal.tmcc
Red Belt

  • Worked perfectly, many thanks SMal

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


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