• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
keythom

WinPE 2.0 simple Ghost Menu HTA

118 posts in this topic

Now I have 2 all white boxes that pop up with nothing on them when I load the image. I have the HTA, Scripting, Legacy Setup packages added to the image. Does anybody know what code is changed in 3.0? Need Help to get this to work.

Thanks

I've not used this HTA before, but I know I had to make some VBScript changes in mine to work with WinPE 3.0. I'm not sure what would need to be changed in this one.

0

Share this post


Link to post
Share on other sites

Ok,

I just switched to winpe 2.0 instead of 3.0. But now I am getting the access denied problem when I call my .hta file from the mapped drive cmd.exe /c Mshta.exe z:\wizard.hta. Did anyone ever solve this problem? I do not want to use the X: system drive. I prefer to stick with the mapped network drive for editing purposes.

0

Share this post


Link to post
Share on other sites

I found the solution in another thread to the access denied problem but now I have an all white .hta file that comes up on my winpe image.

0

Share this post


Link to post
Share on other sites

You are likely battling network permissions. I never tried to run an HTA from a network share. Use a USB key (or WDS) to have your boot image on, so you can easily mount and edit it.

0

Share this post


Link to post
Share on other sites

I was able to get the .hta file to work over the network except for the information in my .htm files does not show up. I created the files using excel and saved them as html files in my ghost images directory. All the category buttons show up and the radio button show up but the information in the .htm files does not show up on the side when I click one of my radio buttons. It just give an script error message and asks if I would like to continue. Any ideas on what's wrong?

0

Share this post


Link to post
Share on other sites

I'd be scared to see the source of an html file made in Excel. :o

Your first step is to start with the script error. What does it say?

0

Share this post


Link to post
Share on other sites

It just states that there was an script error and that the script could not run. The error was not specific.

0

Share this post


Link to post
Share on other sites

I'd be scared to see the source of an html file made in Excel. :o

And you would be right! :thumbup

All those Msohtml tags could grab you at the ankles :ph34r: and drag you with them in the abysses of perverse abomination ..... :w00t:

This one is a single sheet workbook created from scratch with just "Hello, world!" in A1:


<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 10">
<link rel=File-List href="hallo_file/filelist.xml">
<link rel=Edit-Time-Data href="hallo_file/editdata.mso">
<link rel=OLE-Object-Data href="hallo_file/oledata.mso">
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>jaclaz</o:Author>
<o:LastAuthor>jaclaz</o:LastAuthor>
<o:Created>2011-10-04T15:57:36Z</o:Created>
<o:LastSaved>2011-10-04T15:58:28Z</o:LastSaved>
<o:Version>10.2625</o:Version>
</o:DocumentProperties>
<o:OfficeDocumentSettings>
<o:DownloadComponents/>
<o:LocationOfComponents HRef="file:///E:\"/>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<style>
<!--table
{mso-displayed-decimal-separator:"\,";
mso-displayed-thousand-separator:"\.";}
@page
{margin:.98in .79in .98in .79in;
mso-header-margin:.5in;
mso-footer-margin:.5in;}
tr
{mso-height-source:auto;}
col
{mso-width-source:auto;}
br
{mso-data-placement:same-cell;}
.style0
{mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
mso-rotate:0;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size:10.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset:0;
border:none;
mso-protection:locked visible;
mso-style-name:Normale;
mso-style-id:0;}
td
{mso-style-parent:style0;
padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size:10.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset:0;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
border:none;
mso-background-source:auto;
mso-pattern:auto;
mso-protection:locked visible;
white-space:nowrap;
mso-rotate:0;}
-->
</style>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions>
<x:Selected/>
<x:Panes>
<x:Pane>
<x:Number>3</x:Number>
<x:ActiveRow>1</x:ActiveRow>
</x:Pane>
</x:Panes>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:WindowHeight>12015</x:WindowHeight>
<x:WindowWidth>21915</x:WindowWidth>
<x:WindowTopX>0</x:WindowTopX>
<x:WindowTopY>105</x:WindowTopY>
<x:ProtectStructure>False</x:ProtectStructure>
<x:ProtectWindows>False</x:ProtectWindows>
</x:ExcelWorkbook>
</xml><![endif]-->
</head>

<body link=blue vlink=purple>

<table x:str border=0 cellpadding=0 cellspacing=0 width=77 style='border-collapse:
collapse;table-layout:fixed;width:58pt'>
<col width=77 style='mso-width-source:userset;mso-width-alt:2816;width:58pt'>
<tr height=17 style='height:12.75pt'>
<td height=17 width=77 style='height:12.75pt;width:58pt'>Hello, world!</td>
</tr>
<![if supportMisalignedColumns]>
<tr height=0 style='display:none'>
<td width=77 style='width:58pt'></td>
</tr>
<![endif]>
</table>

</body>

</html>

jaclaz

0

Share this post


Link to post
Share on other sites

Well in that case, I'd recommend you use some other type of editor to work with your HTA file. I can see WinPE may have a lot to complain about with code like that.

0

Share this post


Link to post
Share on other sites

Can HTAs work properly if they are lauched from a mapped network drive? When I launch my HTA file from the local machine everthing works perfectly but nothing works when I launch it from a mapped drive.

0

Share this post


Link to post
Share on other sites

I found the solution in another thread to the access denied problem but now I have an all white .hta file that comes up on my winpe image.

You are likely battling network permissions. I never tried to run an HTA from a network share. Use a USB key (or WDS) to have your boot image on, so you can easily mount and edit it.

Can HTAs work properly if they are lauched from a mapped network drive? When I launch my HTA file from the local machine everthing works perfectly but nothing works when I launch it from a mapped drive.

Back to this again? If you want to keep your HTA on the network drive, that's fine. Try copying it to the RAMDISK and run it from there.

0

Share this post


Link to post
Share on other sites

hi,

Maybe this post is old, but he deserves to be reviewed.

I tried to reproduce the same, but without success, I get an error at this line:

For Each objFile in colFileList

I suspicion this piece of code :

Set colFileList = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='z:\\winpe\\" & fileName & "'} Where " & "ResultClass = CIM_DataFile")

"colFileList" is not a collection

When i use MsgBox to display it's contents (filename) i get " & fileName & "

Thank you for help

0

Share this post


Link to post
Share on other sites

I'll agree. The WMI code is suspect because it is written expecting it to work 100% of the time. For example, there is no check to see if the data collected is an object, or is an array.

Did you install the WMI package into your WinPE? Are you using WinPE 2.0 like the OP has this coded for?

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.

0

Share this post


Link to post
Share on other sites

Hi,

Tested on online OS (W7) and I think that's enough.

Set colFileList = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='z:\\winpe\\" & fileName & "'} Where " & "ResultClass = CIM_DataFile")

If I understand this code, The Win32_Directory.Name is directory class and the return type is file so it don't work. I tried some other stuff without success.

If someone has successfully make it work, (keeping the same idea) thank you in advance for clarification.

0

Share this post


Link to post
Share on other sites

Hi,

Tested on online OS (W7) and I think that's enough.

I would disagree. There are way too many differences between WinPE 3.0 and Windows 7 to rely on testing on a live OS to be enough.

0

Share this post


Link to post
Share on other sites

Has anybody adjusted this script to work in winpe 4.0?

0

Share this post


Link to post
Share on other sites

Thank you very much to all for your information, especially Keythom, this is just what I needed.

I've configured everything with WinPE 3.0 and works properly, about the restart after the ghost, the problem is that the path should be of MS-DOS, there are two options or leave the ghost in a shorter route or put the path type ms-dos, I've configured with the second option and I've added a small vbs as showing a message over and press OK to restart the computer.

strTaskValue = "cmd /C x:\progra~2\ghost\ghost32.exe" & " -clone,mode=restore,src=" & Chr(34) & Radio.Id & ".gho" & Chr(34) & ",dst=1,sze1=30000M,sze2=V -sure " & chr(38) & " z:\WinPE\mensaje.vbs" & chr(38) & " wpeutil reboot"

0

Share this post


Link to post
Share on other sites

I know this topic is pretty old but I was rehashingi t for use in my environment recently. If anyone is having Script errors when the program runs it is likely related to your folder structure. Ensure your host system has Z:\images\winpe for example. I accidentally created only Z:\winpe and then I mapped it in the startnet.cmd. So when the script looked for winpe it wasnt there, hope this helps someone late to the game.

Also, if you want to make an easy .htm details for your images use Word 2013 and save as a Web Page Filtered.

Edited by baxtin
0

Share this post


Link to post
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.