MSFN Forum: WinPE 2.0 simple Ghost Menu HTA - MSFN Forum

Jump to content


  • 6 Pages +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

WinPE 2.0 simple Ghost Menu HTA a simple HTA to make Ghosting easy Rate Topic: -----

#21 User is offline   idanlerer 

  • Group: Members
  • Posts: 4
  • Joined: 27-June 07

Posted 28 June 2007 - 12:03 PM

Thanks a lot.
I think this is also a resolution problem sine the button are very big.
What do you think ? any option to change, I don't understand why the button are bigger then the print screen in this post


#22 User is offline   Bumbastik 

  • Newbie
  • Group: Members
  • Posts: 32
  • Joined: 31-October 05

Posted 28 June 2007 - 02:57 PM

I suppose your problem is resolution of WinPe

Is you wont change resolution see this post

http://www.msfn.org/...showtopic=99197

This hta work fine , set WinPe resolution at 1024*768 ( setres h1024 v768 b21 ) and modify windows state parameter ( normal -> fullscreen

bye
BB

#23 User is offline   tap52384 

  • nLite Lover
  • PipPipPip
  • Group: Members
  • Posts: 331
  • Joined: 11-August 04

Posted 28 June 2007 - 03:03 PM

The person who started this thread recommended that we use PXE to install ImageX; how do you set up PXE? Does the computer have to be on a domain?

#24 User is offline   zorphnog 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 427
  • Joined: 25-July 06

Posted 29 June 2007 - 08:21 AM

PXE has to be on a DHCP server. You can use RIS or PXElinux. I use PXElinux you can find it information about it here.

#25 User is offline   zstokes 

  • Group: Members
  • Posts: 6
  • Joined: 06-April 07

Posted 29 June 2007 - 08:29 AM

This is a neat tool! I inherited a GUI made using AutoIT tools, but the fact that this dynamically creates radio buttons is a much nicer solution.

I am having an issue though - When I click start to launch ghost, it just hangs. Anyone else have this issue? I have installed all scripting, WMI, XML and HTA components. It DOES run fine from a full WindowsXP system...

Z

#26 User is offline   zstokes 

  • Group: Members
  • Posts: 6
  • Joined: 06-April 07

Posted 29 June 2007 - 11:34 AM

Issue resolved. When I upped the resolution to 1280x1024 the problem went away completely. Now, ghost starts right up and starts plugging away.

Z

#27 User is offline   JuMz 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 466
  • Joined: 09-August 04

Posted 20 July 2007 - 11:10 AM

Cool HTA!

#28 User is offline   zstokes 

  • Group: Members
  • Posts: 6
  • Joined: 06-April 07

Posted 26 July 2007 - 09:27 AM

I love this tool, and am just about ready to roll it into production - many thanks!

I have one question:
When Ghost finishes, I have the -rb flag set, but it doesn't seem to work. The hta is still up, and I have to manually hit the Reboot button to get the system to reboot.

Any ideas on how I can actually get the system to reboot when Ghost is finished? I'm using Ghost8 in my environment as well.

Thanks,
Z

#29 User is offline   zorphnog 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 427
  • Joined: 25-July 06

Posted 27 July 2007 - 07:19 AM

Yeah the reboot functionality of ghost does not work within the PE environment, at least not 8.2 (which I use most often). However, it does work with 11.0. Anyway, what I do is launch ghost with the "-fx" switch which exits ghost after cloning has finished, and reboot via the "wpeutil reboot" command once ghost has completed.

I've written my own HTA for restoring ghost images from disk, but the meat of the code still applies. Just ignore all of the html stuff:
'*****************************************************************************************
'* restoreBuild
'* starts the ghost restoration process for the selected build and method
'*****************************************************************************************
Sub restoreBuild
  Dim filename, taskCmd

  strTemp = "<h2>Restoring build...</h2>"
  general.InnerHTML = strTemp

  filename = cdrom & "\" & buildFilename
  If not objFso.FileExists(filename) Then
	strTemp = "<h2>ERROR: File not found " & filename & "</h2><ul>Ensure that <u><b>DISK 1</b></u> is loaded in the CD-ROM drive and click the " &_
			  "<i>Retry</i> button."
	document.buttonsForm.nextButton.value = "<u>R</u>etry"
	document.buttonsForm.nextButton.disabled = false
	document.buttonsForm.cancelButton.disabled = false
	general.InnerHTML = strTemp
  Else
	taskCmd = "%comspec% /c ghostontop.exe"
	objShell.Run taskCmd,0,false
	Select Case curMethod
	  Case "Initial"
		taskCmd = "%comspec% /c ghost32.exe -sure -fdsp -clone,mode=load,src=" & filename & ",dst=" & destinationDisk & ",szeL -fx > \ghost.log"
		objShell.Run taskCmd,0,true
		finishBuild
	  Case "Windows"
		taskCmd = "%comspec% /c ghost32.exe -sure -fdsp -clone,mode=prestore,src=" & filename & ":1,dst=" & destinationDisk & ":1,sze1=V -fx > \ghost.log"
		objShell.Run taskCmd,0,true
		finishBuild
	End Select
  End If
End Sub

'*****************************************************************************************
'* finishBuild
'* handles errors that occur during ghost and handles successful restorations
'*****************************************************************************************
Sub finishBuild
  Dim result, logFile, count

  Set logFile = objFso.GetFile("\ghost.log")
  If logFile.Size <> "0" Then
	Set logFile = objFso.OpenTextFile("\ghost.log")
	count = 1
	Do While logFile.AtEndOfStream <> true
	  result = result & count & "> " 
	  Do While logFile.AtEndOfLine <> true or logFile.AtEndOfStream <> true
		result = result & logFile.Read(1)
	  Loop
	  result = result & "<BR>"
	  general.InnerHTML = result
	  count = count + 1
	Loop
	logFile.Close
	strTemp = "<CENTER><H1>FAILED</H1><DIV style='color:red;text-align:left'>An attempt to restore the system failed with the " &_
			  "following error message:<BR><BR><DIV style='position:absolute;border-style:solid;border-color:black;left:5%;" &_ 
			  "width:95%;color:black;padding:5%;border-width:1;font-family:terminal;font-size:10pt;overflow:auto'>" & result &_
			  "</DIV></DIV></CENTER>"
	warning.InnerHTML = strTemp
	warning.style.top = "10%"
	warning.style.left = "10%"
	warning.style.width = "80%"
	warning.style.height = "75%"
	document.buttonsForm.cancelButton.value = "E<u>x</u>it"
	document.buttonsForm.cancelButton.accesskey = "x"
	document.buttonsForm.cancelButton.disabled = false
	warning.style.visibility = "visible"
  Else
	strTemp = "<h2>Complete!</h2><ul><font color=orange>" & result & "</font>The restoration process has finished without any " &_
			  "errors."
	document.buttonsForm.cancelButton.value = "E<u>x</u>it"
	document.buttonsForm.cancelButton.accesskey = "x"
	document.buttonsForm.cancelButton.disabled = false
	general.InnerHTML = strTemp
	warning.style.visibility = "visible"
	If needHAL = "yes" Then
	  handleHAL
	Else
	  rebootMe
	End If
  End If
End Sub

'*****************************************************************************************
'* handleHAL
'* prepares the system for use with the correct HAL
'*****************************************************************************************
Sub handleHAL
  Dim strDest, inFile, outFile, line, words, lword

  strTemp = "<CENTER><H1>Updating HAL...</H1></CENTER>"
  warning.InnerHTML = strTemp
  objShell.Run "%comspec% /c diskpart /s X:\Windows\system32\probeParts.txt",0,true

  Select Case strHAL
	Case "acpiapic"
	  'Remove UpdateUPHal line from sysprep.inf
	  strDest = "C:\sysprep\sysprep.inf"
	  If objFso.FileExists(strDest) Then
		Set inFile = objFso.OpenTextFile(strDest,1,true)
		Set outFile = objFso.CreateTextFile(strDest & ".tmp",true)

		'Loop through sysprep.inf file
		Do While inFile.AtEndOfStream <> true
		  line = inFile.ReadLine
		  If line <> "" Then
			words = split(line,"=")
			lword = trim(words(0))
			outFile.WriteLine(line)
			If Lcase(lword) = "[unattended]" Then
			  If numProcs = 1 Then
				outFile.WriteLine("UpdateUPHAL=ACPIAPIC_UP,%WINDIR%\Inf\Hal.inf")
			  Else
				outFile.WriteLine("UpdateHAL=ACPIAPIC_MP,%WINDIR%\Inf\Hal.inf")
			  End If
			End If
		  Else
			outFile.WriteBlankLines(1)
		  End If
		Loop
		inFile.Close
		outFile.Close
		objFso.DeleteFile strDest,true
		objFso.MoveFile strDest & ".tmp", strDest
	  Else
		strTemp = "<CENTER><H1>FAILED</H1><DIV style='color:red;text-align:left'>An attempt to update your system HAL has " &_
				  "failed due to an inaccessible system drive.</DIV></CENTER>"
		warning.InnerHTML = strTemp
		warning.style.top = "10%"
		warning.style.left = "10%"
		warning.style.width = "80%"
		warning.style.height = "75%"
		document.buttonsForm.cancelButton.value = "E<u>x</u>it"
		document.buttonsForm.cancelButton.accesskey = "x"
		document.buttonsForm.cancelButton.disabled = false
	  End If
	  rebootMe
	Case Else
	   rebootMe
  End Select
End Sub

'*****************************************************************************************
'* rebootMe
'* opens the CD tray, delays 8 seconds and reboots
'*****************************************************************************************
Sub rebootMe
'Open CD tray
  strTemp = "<center><h1>Ejecting Media...</h1></center>"
  warning.InnerHTML = strTemp
  cdrom = cdrom & "\"
  CreateObject("Shell.Application").Namespace(17).ParseName(cdrom).InvokeVerb("Eject")

'Give delay to allow disk to eject
  objShell.Run "%comspec% /c cscript X:\Windows\system32\timer.vbs",0,true

'Reboot the system
  strTemp = "<center><h1>Rebooting System...</h1></center>"
  warning.InnerHTML = strTemp
  objShell.Run "%comspec% /c wpeutil reboot",0,false
End Sub

This post has been edited by zorphnog: 27 July 2007 - 07:29 AM


#30 User is offline   zstokes 

  • Group: Members
  • Posts: 6
  • Joined: 06-April 07

Posted 27 July 2007 - 09:00 AM

Thanks - this was something simple that I just haven't seen yet - wpeutil reboot.

I really need to learn to RTM.

Cheers,
Z

#31 User is offline   Obet31 

  • Group: Members
  • Posts: 5
  • Joined: 22-April 04

Posted 11 October 2007 - 02:36 PM

Thanks for sharing. I've taken a lot of the code into my own HTA but again I'm a newbie at this.

Can someone help me or point me to the correct direction on how to change the background image when an option is chosen from using a radio button? Here is my situation:

I added two(radio) buttons that say (development and production) to readily distinguish the environment that they are going to get the image from. My problem is I cannot change the background image (am totally inexperience in html or hta) defined in <DIV>. Can someone please help me on how to do this?

What I am doing is this:

strBody = strBody & "<td><Input type=radio name=envList checked value=Production onclick=ChangeBG>" &_
"Production" & "</BUTTON><BR>"
strBody = strBody & "<Input type=radio name=envList value=Development onclick=ChangeBG>" &_
"Development" & "</BUTTON></td>"

sub changeBG
...
end sub

Is it possible to change it this way? What am I suppose to put in the "changeBG" to change the SRC?


Thank you very much.

You guys rock!!!

#32 User is offline   zorphnog 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 427
  • Joined: 25-July 06

Posted 12 October 2007 - 07:19 AM

strBody = strBody & "<td><Input type=radio name=envList checked value=Production onclick=proBG>" &_
"Production" & "</BUTTON><BR>"
strBody = strBody & "<Input type=radio name=envList value=Development onclick=devBG>" &_
"Development" & "</BUTTON></td>"


Sub proBG
  bg.InnerHTML = "<img src='probg.bmp'>"
End Sub

Sub devBG
  bg.InnerHTML = "<img src='devbg.bmp'>"
End Sub


#33 User is offline   Obet31 

  • Group: Members
  • Posts: 5
  • Joined: 22-April 04

Posted 12 October 2007 - 07:58 AM

Thanks Zorph. Thank you. thank you... :D

#34 User is offline   Stratuscaster 

  • Newbie
  • Group: Members
  • Posts: 31
  • Joined: 05-April 07

Posted 19 October 2007 - 03:29 PM

What I'm finding is that whenever I attempt to launch a command line - for example, the entire "ghost32.exe -mode=load src=c:\image.gho etc..." it fails.

Usually I get a "the user cancelled this command" or something like that.

It seems to be related to the use of spaces in the variables building the command. I can launch the executable itself without issue, but try to add the switches to it and it fails.

#35 User is offline   zorphnog 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 427
  • Joined: 25-July 06

Posted 22 October 2007 - 07:19 AM

What is the exact command you are trying to run?

#36 User is offline   Stratuscaster 

  • Newbie
  • Group: Members
  • Posts: 31
  • Joined: 05-April 07

Posted 23 October 2007 - 09:27 AM

t:\Programs\ghost11\files\ghost32.exe  -clone,mode=restore,src=k:\images\sample.gho,dst=1

If I run just the executable part (t:\Programs\ghost11\files\ghost32.exe) it runs fine. Once I add the switches, it fails.

#37 User is offline   egronski 

  • Group: Members
  • Posts: 1
  • Joined: 23-October 07

Posted 23 October 2007 - 01:04 PM

I am just floored right now, this is exactly what I need for our manufacturing environment. We currently use a DOS based imaging setup which was old when we created it, now it's up to me to bring our imaging up to the 32-bit standard. I am so pumped to find all this information, its going to take me a while to take it all in but I just wanted to pop up and say wow. :thumbup

#38 User is offline   zorphnog 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 427
  • Joined: 25-July 06

Posted 23 October 2007 - 02:12 PM

View PostStratuscaster, on Oct 23 2007, 11:27 AM, said:

t:\Programs\ghost11\files\ghost32.exe  -clone,mode=restore,src=k:\images\sample.gho,dst=1

If I run just the executable part (t:\Programs\ghost11\files\ghost32.exe) it runs fine. Once I add the switches, it fails.


You're missing the last part of the clone command, the sze parameter.

#39 User is offline   Stratuscaster 

  • Newbie
  • Group: Members
  • Posts: 31
  • Joined: 05-April 07

Posted 24 October 2007 - 08:53 AM

View Postzorphnog, on Oct 23 2007, 03:12 PM, said:

View PostStratuscaster, on Oct 23 2007, 11:27 AM, said:

t:\Programs\ghost11\files\ghost32.exe  -clone,mode=restore,src=k:\images\sample.gho,dst=1

If I run just the executable part (t:\Programs\ghost11\files\ghost32.exe) it runs fine. Once I add the switches, it fails.


You're missing the last part of the clone command, the sze parameter.

While that may be - and likely due to me just leaving it off when typing my reply - it doesn't solve the issue I'm having.

#40 User is offline   zorphnog 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 427
  • Joined: 25-July 06

Posted 24 October 2007 - 12:17 PM

Ok I've read some more and I think I was wrong about the sze switch as it is not necessarily needed, but still think the error is in the syntax of your switch. I've searched and I cannot find a mode=restore. There is a mode=prestore or mode=load. The prestore mode restores a specific partition and the load mode restores the entire disk. Heres a link to the -clone syntax. Switches: Cloning

Share this topic:


  • 6 Pages +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • 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