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

WinPE 2.0 GimageX COM based HTA

357 posts in this topic

geezer - I get the same result in ver 2.1, after diskpart completes nothing happens. If I substitute this code(which is posted on page 2) the apply button works perfectly.

'****************************************************************************
'* showRadioInfo
'* display details of radio button selection in details divider
'****************************************************************************
Sub showRadioInfo
Dim objTextFile, Radio, strRadioValue, strDetails, objSel1, strFile

Set objSel1 = window.document.getElementById("select1")
strFile = myFilePath + objSel1.options(objSel1.selectedindex).text

details.style.visibility = "visible"
start.style.visibility = "visible"
For Each Radio in Document.getElementsByName("radioList")
If Radio.Checked = True Then
strTaskValue = "imagex /apply " + strFile + " " + Radio.Id + " c:"
End If
Next
Details.innerHTML = "<BR><table id='detailsTable'><tr><td>" & strDetails & "</td></tr></table><BR>"
End Sub

ccb458 - How did you call your Reboot option using a cmd.bat file to restart your computer after imagex runs?

0

Share this post


Link to post
Share on other sites

have same problem, apply isn't working.

have tried what thebearpoo suggested but still doesn't work for me either.

0

Share this post


Link to post
Share on other sites

I tried to add a line to my startnet.cmd to get this imagex.hta to load on startup but i get an access denied error. Is auto loading this hta not posible?

0

Share this post


Link to post
Share on other sites

Sorry dudes, I cant help you today, because I can't make any tests.

jstchill ->

Did you tried it on real environment or Virtual? I got also those errors when I tried on MS VirtualPC and Innotek Virtualbox.

0

Share this post


Link to post
Share on other sites

I am building a bootable USB key. so its a real enviroment. I think i figured it out it works on a machine with 512 MB Ram but not on a 256MB ram machine.

0

Share this post


Link to post
Share on other sites

Jstchil,

Your problem maybe due to the limitation of the memory environment required by winpe. Maybe with 256mb ram, something can't be loaded. Have to check Microsoft's website.

Geezery,

Take a break today. I don't know how many thanks I should tell you as I am trying your hta file out in my company environment. We need to deploy images out and we used to use OSD for this, but now we want to fit everything into a USB or DVD disc. We havn't finished the script yet.. (as I am not a scripting guy), but you sure have helped us a lot.

Look forward to see what you could find out about the bug. Maybe you could tell me what lines I should add to add to your hta file to show the value of "STRTASKVALUE" in a pop-up window. Then we could troubleshot faster..

thx

strTaskValue = "imagex /apply "+objSel2.options(objSel2.selectedindex).text+" " + Radio.Id + " c:"

Edited by ccb458
0

Share this post


Link to post
Share on other sites

I try to fix all the errors today. Problem is that I don't have any test environment since I haven't been able to test in virtual environment. I have to try raising the virtual memory. I also havent got network working properly in virtual environment.

0

Share this post


Link to post
Share on other sites

Yeah, I tried making that change and it still just performs the diskpart then does not proceed with the apply of the image.

0

Share this post


Link to post
Share on other sites

OK, I think the problem is around line 143. I am working on it now to see if I can get it fixed.

0

Share this post


Link to post
Share on other sites

Getting closer, I saw briefly that it displayed the help for imagex like the syntax is incorrect somewhere.

0

Share this post


Link to post
Share on other sites

Ok, I finally got this HTA working on VMWARE with network support, so it was easier to locate the bug.

I upped a new version again, I hope it works.

There was a little error on line 327

Original:

strTaskValue = "imagex /apply "+objSel2.options(objSel2.selectedindex).text+" " + Radio.Id + " c:"

Fixed:

strTaskValue = "imagex /apply " & myfilepath +objSel2.options(objSel2.selectedindex).text+" " + Radio.Id + " c:"

so the path to the wim files were missing.

0

Share this post


Link to post
Share on other sites

I'm working on the file path popup on the start, but the error handling I want is a little tricky. Would that chkdsk /r option be good? I can put that one in the next rel if you guys want.

I'm out of ideas, so if you have some put it here. Maybe those capture and append could be better done, but I don't personally use those much. So if someone want's to improve those go on. But I hope you post the improved versions here also.

Like I mentioned here I got this also working on vmware when I put 600mb virtual memory. I didn't test what is the limit, but I think that is enough.

0

Share this post


Link to post
Share on other sites

I am good with what is there. I mainly wanted to look at multiple WIMs and be able to cpature and you more than exceeded it for me. I am good. Thanks!!!!!!

0

Share this post


Link to post
Share on other sites

The capture side of things does work well, but of the 5-6 computers I have imaged for backup purposes it is quite common for there to be a corrupted file in the temporary internet files, unfortunately it gets half way through the capture before hitting the T.I.F. so it would be a major advantage to run chkdsk on a drive before the capture/append. Using /r (bad sector search) would add too much time to the whole process while /f repairs the issues enough to get a good image without crashing halfway through.

In regards to new ideas/improvements for this project, I'm not a scripter by any means so I'm not sure of the difficulty of this, but in regards to being able to choose/change the wim location with a prompt when starting the HTA. is there any way to run diskpart list volume and display the result within the HTA when the prompt comes up, making it easier to see which partitions/volume are where.

Edited by solutionone
0

Share this post


Link to post
Share on other sites

I personally don't think chkdsk should be there..

A you can do it before you load into winpe.

B You're then be trying to make it into a repair and backup solution which is what WinRE is really.

@Geezery

I have being doing some test's on spilt wim files and tried out the spanned media option for in the WAIK using the Vista as a source and this somehow copys over each SWM file required to the drive (After you cut your drive up) asking for cd on the way. adding this feature would be very handy for those that do not have dvd's and machine that take an age to boot by USB.

I am not sure how you would be able to assign the cd rom letter so it gets the same one all the time.

0

Share this post


Link to post
Share on other sites
I personally don't think chkdsk should be there..

A you can do it before you load into winpe.

B You're then be trying to make it into a repair and backup solution which is what WinRE is really.

A: I sort of see where you are coming from p4mtb0y, but I have noticed several posters say they are setting the imagex.hta to start with WinPE as they didn't want their techs mucking around. In these cases it would mean they would have to back out of the hta and start it again afterwards which seems a bit pointless.

To satisfy both camps on this one, seeing as it wouldn't need a major change, perhaps a simple "do you want to run chkdsk" before proceeding could pop up when using capture/append. If the user clicks yes it just waits till the user enters which drive letter they which to capture/append and then uses this varible to run the chkdsk and the imagex command.

B: I disagree with you here, the point of running the chkdsk in my eyes is to prevent wasting valuable time with imagex having it get half way through a capture and then failing, I've had some users who had been upgraded to Windows Vista, used it for a couple of months and then had their computer replaced. With imagex it is a simple process of capturing their workstations and then applying the image to the new PC and away they go, no setting up their custom program and settings. Just a simple reactivation and then in most cases Microsoft Update fixes the drivers.

And if it is your boss getting the upgraded computer it eases the process substantially :thumbup

0

Share this post


Link to post
Share on other sites

p4ntb0y ->

I made a little wmi query vbscript. I think you can use it to find cd-driveletter.

Option Explicit
Call FindCD()

Function FindCD
Dim strComputer, objWMIService, colItems, objItem, CDLetter
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_CDROMDrive",,48)
For Each objItem in colItems
Wscript.Echo objItem.Drive
Next
End Function

I haven't tried it yet in WinPE, but I think it should work. I think I'm going to release a new version tomorrow with some nice extras.

Edited by geezery
0

Share this post


Link to post
Share on other sites

looking forward to tomorrows release, keep up the excellent work geezery.

0

Share this post


Link to post
Share on other sites

Added a new version again. Look at the first post.

v.0.23

-Reboot option after Apply, Append & Capture

-Added running chkdsk /x before Append and Capture. (Same as chkdsk /f, but it is kind of forced switch)

-Changed the buttons to icons

Coming in the next release:

-Status of the disks

-Network mapping

Edited by geezery
0

Share this post


Link to post
Share on other sites

Nice,

just did a quick test...

A option to run chkdsk if you want to. would be nice.

A option to save your wim to your letter choice "open save as" explorer, just in case you have a mapped network drive or USB Drive.

just for completeness an Icon for just Capture would be nice, I know you have append but a spearate icon for capture would come in handy.

The ability to copy SWM files to a temp location on the computer then apply the image and delete after.

lol

Nice work!

0

Share this post


Link to post
Share on other sites

sounds good, unfortunately its Queen's Birthday Weekend here in New Zealand, so I'll have to wait till tomorrow to play with it. Looking forward to the next release, the things you've mentioned next sound awesome.

I agree with p4ntb0y about having a separate capture icon though.

Edited by solutionone
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.