Video Screencast Help

Why can't get "RegistryRedirectPath" using WMI and VBS ?

Created: 20 Oct 2010 • Updated: 21 Oct 2010 | 2 comments
This issue has been solved. See solution.

Hello,

I'm trying to get the RegistryRedirectPath for the sublayers of a layer using VBS and WMI and the string is always empty. The string for FileRedirectPath is correct. Why is this happening?

My code is this one:

 SET colItems = objWMIService.ExecQuery ( "Select * from VirtualSoftwarePackage Where Name like

'SuRun%'" )

strGUID = ""
strName = ""

WScript.Echo ""
WScript.Echo "Search GUID of SuRun% Layer"
WScript.Echo "---------------------------"

FOR EACH objItem IN colItems
 WScript.Echo "Name: " & objItem.Name & " " & "GUID: " & objItem.Id
        strGUID = objItem.Id
 strName = objItem.Name
NEXT

SET colItems = objWMIService.ExecQuery ( "Select * from VirtualSoftwareSublayer Where PackageId =

""" & strGUID & """")

WScript.Echo ""
WScript.Echo "Search SuRun SubLayer"
WScript.Echo "---------------------"

FOR EACH objItem IN colItems
 WScript.Echo "Name     : " & strName
 WScript.Echo "GUID     : " & objItem.PackageId
 WScript.Echo "GUID Sub : " & objItem.Id
 WScript.Echo "Type     : " & objItem.Type
 WScript.Echo "File     : " & objItem.FileRedirectPath
 WScript.Echo "Registry : " & objItem.RegistryRedirectPath
NEXT 

The output of this code is this:

 Search GUID of SuRun% Layer
---------------------------
Name: SuRun_1209b14_v1 GUID: d00c8bf7-40fc-46d0-9787-373852e091ee

Search SuRun SubLayer
---------------------
Name     : SuRun_1209b14_v1
GUID     : d00c8bf7-40fc-46d0-9787-373852e091ee
GUID Sub : 82eda496-55a4-4254-bfe1-44cc0678441a
Type     : 1
File     : C:\fslrdr\2
Registry :
Name     : SuRun_1209b14_v1
GUID     : d00c8bf7-40fc-46d0-9787-373852e091ee
GUID Sub : d00c8bf7-40fc-46d0-9787-373852e091ee
Type     : 0
File     : C:\fslrdr\3
Registry :  

Why RegistryRedirectPath are empty?

Thanks!

Comments 2 CommentsJump to latest comment

Jordan's picture

RegistryRedirectPath as of SWV 6.1 SP1 can only be acquired by WMI or API when a layer is active or the hive is mounted for editing (which you cannot currently do with WMI).

If a forum post solves your problem please flag is as the solution

SOLUTION
ManelR's picture

Hi Jordan,

Great, is true ... when the layer is active I get something there ...

Thanks.

IT Systems Manager
LCFIB - Computing Lab
Barcelona School of Informatics
Universitat Politècnica de Catalunya - Barcelona Tech