MSFN Forum: Cannot get target path in WinPE 3.0 - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cannot get target path in WinPE 3.0 WinPE Rate Topic: -----

#1 User is offline   ZeroStack 

  • Group: Members
  • Posts: 9
  • Joined: 12-July 12
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 July 2012 - 03:40 PM

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: http://www.msfn.org/...ghost-menu-hta/

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)

This post has been edited by ZeroStack: 13 July 2012 - 04:09 PM



#2 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,665
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 16 July 2012 - 10:34 AM

What packages have you added into your WinPE?

#3 User is offline   ZeroStack 

  • Group: Members
  • Posts: 9
  • Joined: 12-July 12
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 16 July 2012 - 11:14 AM

View PostTripredacus, on 16 July 2012 - 10:34 AM, said:

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

This post has been edited by ZeroStack: 16 July 2012 - 03:14 PM


#4 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,665
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 17 July 2012 - 08:30 AM

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?

#5 User is offline   ZeroStack 

  • Group: Members
  • Posts: 9
  • Joined: 12-July 12
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 17 July 2012 - 08:36 AM

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...

#6 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,665
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 18 July 2012 - 09:18 AM

There may well be a better way to code this, but I do not know that answer. I am quite green with VBScript. You should post your code-related question here:
http://www.msfn.org/...s-cmdbatch-etc/

And maybe the real programmers can come up with some other ideas to try.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy