Scripting Question

Retrieve List of Mapped Network Drives & Printers via KACE

08/27/2014 6850 views
Is it possible to do this natively in the new version? If not how can it be accomplished?

1 Comment   [ + ] Show comment


  • Thank you for the detailed information, I took a slightly different approach to this.

    Create a Online KScript which runs net use and dumps the mapped.txt to %temp%.

    Then I have a CustomInventory to read that file but It's not showing up even after forcing an Inventory. Am i missing something?
    • %temp% variable is a user variable so same problem, the cir runs as system and looks at its temp area

Community Chosen Answer

The printers are under the machines inventory.  The mapped drives are user items so you need to run the query as the user not system.  So a custom software inventory will not directly work.  I use a 2 step approach.  I run a script to create files from the users stand point for a custom inventory's to read.  This runs invisible every couple of hours during the work days.

I use this method to hide the batch file:

here is the batch file I run in the script

I then use custom inventories to read the files

Answered 08/27/2014 by: SMal.tmcc
Red Belt

  • I guess i'm not familiar with the custom inventories feature. where would i go to get to that? getting this setup would be very useful for me.
  • Currently using KACE server 6.4.120261
  • I think you can disregard, i went to Inventory>software>create new. Looks like where you went.
    • yea
      • when i test run the Kscript, i get this error:


        Line: 1
        Char: 1
        Error: The Sytem Could not find the file specified.
        Code: 80070002
        Source: (Null)

        I've checked the directory these scripts are supposed to go to and they are where they are supposed to be (according to the dir location in this error)

        I've checked the scripts several times and they look good.

        I've checked my custom inventory rules several times and they look the way they're supposed to.

        It seems to brought my HKCU run keys into my custom inventory string, but has failed to do so for the mapped drives.
      • see new answer for this info

All Answers


This was written for 6.2, if you are 6.3 or 6.4 it will hide the batch file for you now.  you can attach the batch and call it or create a online shell script and paste your lines in there.  Make sure if you create a shell script you rename the extension to .bat
like in this example from another question

Answered 02/17/2016 by: SMal.tmcc
Red Belt

  • My mapped drives are still not pulling into the custom inventory field. and the text file it generates for the mapped drives into simply turns up blank - no inventory info in it.

    Here is the .bat file:
    reg.exe query hkcu\software\microsoft\windows\currentversion\run /s > C:\ProgramData\Dell\KACE\user\hkcuRunKeys.txt

    reg.exe query hkcu\software\microsoft\windows\currentversion\uninstall /s /f DisplayName > C:\ProgramData\Dell\KACE\user\hkcuSoftware.txt

    wmic logicaldisk where "drivetype='4" get deviceid,providername > C:\ProgramData\Dell\KACE\user\NetworkDrives.txt


    I also tried this bat as an online shell script like you suggested, but still no dice on the mapped drives.

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