ZeroStack Posted July 13, 2012 Posted July 13, 2012 (edited) 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, strItemReDim 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 NextIt does get the shortcuts, but just not the shortcut path. Any ideas? I can post more code if need be.If I just do aMsgbox "Path =" & objShortcut.targetpathIt 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 July 13, 2012 by ZeroStack
ZeroStack Posted July 16, 2012 Author Posted July 16, 2012 (edited) What packages have you added into your WinPE?I have placed:winpe-mdac.cabwinpe-scripting.cabwinpe-hta.cabwinpe-pppoe.cabwinpe-wds-tools.cabwinpe-wmi.cab Edited July 16, 2012 by ZeroStack
Tripredacus Posted July 17, 2012 Posted July 17, 2012 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?
ZeroStack Posted July 17, 2012 Author Posted July 17, 2012 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...
Tripredacus Posted July 18, 2012 Posted July 18, 2012 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/board/forum/66-programming-c-delphi-vbvbs-cmdbatch-etc/And maybe the real programmers can come up with some other ideas to try.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now