keythom

WinPE 2.0 simple Ghost Menu HTA

118 posts in this topic

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.