Jump to content

Cannot get target path in WinPE 3.0


ZeroStack

Recommended Posts

Hello all,

I am having an issue within my WinPE that I don't know how to resolve. I am going off of this tutuorial:

I have a mapped network drive and I am trying to add the ghost image file address to the ghost command, but it cannot resolve the targetpath of the shortcut. When I do this in my normal OS, it can find everything perfectly - but when I move to my WinPE it cannot get the targetpath. It can get the description and location of the shortcut (lnk) on the mapped drive. Here is my snippet:

...

Dim colFilelist, objFile, strButtons, objShortcut, colTargetList, objTarget, x, y, strKey, strItem
ReDim arrButtons(1,-1)


details.innerHTML = ""
details.style.visibility = "hidden"
Set colFileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='M:\" & fileName & "'} Where ResultClass = CIM_DataFile")
For each objFile in colFileList
'MsgBox objFile.name
If objFile.Extension = "lnk" Then
Set objShortcut = objShell.CreateShortcut(objFile.name)
'odd = objShortcut.targetpath
'MsgBox odd

ReDim Preserve arrButtons(1,UBound(arrButtons,2)+1)
arrButtons(0,UBound(arrButtons,2)) = objShortcut.Description
arrButtons(1,UBound(arrButtons,2)) = "<Input type=radio name=radioList id='" & objShortcut.targetpath &_
"' onClick=showRadioInfo>" & objShortcut.Description & "</BUTTON><BR>"
End If
Next

It does get the shortcuts, but just not the shortcut path. Any ideas? I can post more code if need be.

If I just do a


Msgbox "Path =" & objShortcut.targetpath

It will just show

Path =

But if I do

 Msgbox objShortcut.name 

it will provide the name of the shortcut(lnk) ( same concept with objShortcut.Description)

Edited by ZeroStack
Link to comment
Share on other sites


What packages have you added into your WinPE?

I have placed:

winpe-mdac.cab

winpe-scripting.cab

winpe-hta.cab

winpe-pppoe.cab

winpe-wds-tools.cab

winpe-wmi.cab

Edited by ZeroStack
Link to comment
Share on other sites

I forgot to post this as I posted it in that thread as well:

There is some changes to how VBScript is handled between WinPE 2.0 and WinPE 3.0, this I ran into when I updated my HTA as well. The changes aren't documented as far as I know.

But I wonder if you are having the same problem in WinPE 2.0?

Link to comment
Share on other sites

I dont know, I havent tried as I have only built a WinPE 3.0....

If there are limitations in 3.0 vs 2.0, any idea how I can bypass this issue to get that information of the files on the network drive? I do not want to make the calls static as what would defeat the concept with what I am trying to do lol...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...