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


Please log in to comment


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
Please log in to comment
Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja