t:\Programs\ghost11\files\ghost32.exe -clone,mode=load,src=k:\images\sample.gho,dst=1
The above string, when passed to be run by the click of a button, does not work.
Posted 24 October 2007 - 01:30 PM
t:\Programs\ghost11\files\ghost32.exe -clone,mode=load,src=k:\images\sample.gho,dst=1
Posted 24 October 2007 - 02:24 PM
This post has been edited by zorphnog: 24 October 2007 - 02:25 PM
Posted 24 October 2007 - 02:29 PM
<html>
<!--
'********************************************************************
'*
'* File: wizard.hta
'* Author: greg & fisher
'* Created: Mar 2007
'* Modified:
'* Version: .9
'*
'* Description: windows imaging platform
'*
'* Dependencies: tested on and for WinPE 2.0 with WMI, Scripting,
'* XML, HTA packages
'* Notes: Line 26 - might want to make this "normal" when you are
'* testing and don't want the hta fullscreen
'* Line 58 - customize your headings here
'* Line 72, 101 - confirm directory.name path, this would be a mapped
'* drive to the filer where the images shorcut dir is
'* Line 193 - confirm background image source location
'* Line 200 - confirm path to ghost executable
'*
'********************************************************************
-->
<!****************************************************************************>
<!* HTA Header >
<!****************************************************************************>
<HEAD>
<TITLE>Imaging Application</TITLE>
<HTA:APPLICATION
BORDER = None
APPLICATION = Yes
WINDOWSTATE = normal
INNERBORDER = No
SHOWINTASKBAR = Yes
SCROLL = No
APPLICATIONNAME = "Windows PE Wizard"
NAVIGABLE = Yes
>
<!-- external stylesheet -->
<link rel="stylesheet" type="text/css" href="htaStyle.css" />
</HEAD>
<!****************************************************************************>
<!* Begin Script >
<!****************************************************************************>
<script Language=VBScript>
'****************************************************************************
'* Globals
'* setup global script parameters
'****************************************************************************
Option Explicit
Dim strTaskValue, objShell, objFso, strBody, objWmiService
Set objShell = CreateObject("WScript.Shell")
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject ("winmgmts:\\.\root\cimv2")
'****************************************************************************
'* Window_OnLoad
'* load up behavior and preferences
'****************************************************************************
Sub Window_Onload
self.Focus()
strBody = "<H1>PE Build and Recovery Environment</H1>" &_
"<H2>Select Images to apply an OS image using Ghost.<BR><BR>" &_
"Please select an image category:<BR><BR>"
enumDirs
End Sub
'****************************************************************************
'* enumDirs
'* find directories and create category buttons
'****************************************************************************
Sub enumDirs
Dim colSubfolders, objFolder, fileName
'enumerate folders in images folder
Set colSubfolders = objWMIService.ExecQuery _
("Associators of {Win32_Directory.Name='z:\winpe'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent")
'create html buttons from each folder name
For Each objFolder in colSubfolders
fileName = objFolder.fileName
strBody = strBody &_
"<button id='" & fileName & "' onClick='enumImages("" & fileName & "")'>" & fileName & "</BUTTON>"
Next
'post resulting html body to document
strBody = strBody & "<BR><HR><BR>"
body.innerHTML = strBody
End Sub
'****************************************************************************
'* enumImages
'* find images and create radio buttons
'****************************************************************************
'this sub is a little messy because of limitations of win32_shortcutfile and need to go between fso and wmi for different info
'also, without the advantages of .net sorting classes, the old bubble sorting is not the funnest
Sub enumImages(fileName)
Dim colFilelist, objFile, strButtons, objShortcut, colTargetList, objTarget, x, y, strKey, strItem
ReDim arrButtons(1,-1)
'reset display element style
details.innerHTML = ""
details.style.visibility = "hidden"
' strButtons = "<table id=buttonTable>"
'enumerate ghost image shortcuts in specific images subfolder from enumDirs
Set colFileList = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_Directory.Name='z:\winpe\" & fileName & "'} Where ResultClass = CIM_DataFile")
'find ghost image shortcut targetpath (fso)
For each objFile in colFileList
If objFile.Extension = "lnk" Then
Set objShortcut = objShell.CreateShortcut(objFile.name)
'find ghost image shortcut target (wmi)
Set colTargetList = objWMIService.ExecQuery _
("Select * from CIM_Datafile Where name = '" & replace(objShortcut.targetpath,"\","\\") & "'")
'add radio button label (from fso) and radio button target (from wmi) to an array
For each objTarget in colTargetList
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='" & objTarget.Drive & objTarget.Path &
objTarget.fileName &_
"' onClick=showRadioInfo>" & objShortcut.Description & "</BUTTON><BR>"
Next
End If
Next
'perform a a shell sort of the string array based on button label
For x = 0 To UBound(arrButtons,2) - 1
For y = x To UBound(arrButtons,2)
If StrComp(arrButtons(0,x),arrButtons(0,y),vbTextCompare) > 0 Then
strKey = arrButtons(0,x)
strItem = arrButtons(1,x)
arrButtons(0,x) = arrButtons(0,y)
arrButtons(1,x) = arrButtons(1,y)
arrButtons(0,y) = strKey
arrButtons(1,y) = strItem
End If
Next
Next
'create combined buttons html code from sorted buttons array
For x = 0 To UBound(arrButtons,2)
strButtons = strButtons & "<tr><td id=buttonTd>" & arrButtons(1,x) & "</td></tr>"
Next
' strButtons = strButtons & "</table>"
'create a start button with start image command and append and post resulting html to body
body.innerHTML = strBody & strButtons & "<BR><HR><BR><button id=start Accesskey=S onclick=doTask(strTaskValue)><U>S</U>tart
Image!</BUTTON><BR>"
start.style.visibility="hidden"
End Sub
'****************************************************************************
'* doTask
'* run task selected by radio button
'****************************************************************************
Sub doTask(doMe)
objShell.Run doMe
End Sub
'****************************************************************************
'* showRadioInfo
'* display details of radio button selection in details divider
'****************************************************************************
Sub showRadioInfo
Dim objTextFile, Radio, strRadioValue, strDetails
'set details and start element styles
details.style.visibility = "visible"
start.style.visibility = "visible"
'find checked button
For Each Radio in Document.getElementsByName("radioList")
If Radio.Checked = True Then
'create imaging command line from button id
strTaskValue = Chr(34) & "t:\Programs\ghost11\files\ghost32.exe" & Chr(34) & " -clone,mode=load,src=" & Chr(34) &
Radio.Id & ".gho" & Chr(34) & ",dst=1"
'display image details in details element if they exist
If objFso.FileExists(Radio.Id & ".htm") Then
Set objTextFile = objFso.OpenTextFile(Radio.Id & ".htm", 1)
strDetails = objTextFile.ReadAll()
Else
'display error message in details element if no matching details file found
strDetails = "Can't find anything!!!<BR><BR>" &_
"Make sure the info file has the same name as the .gho and has an .htm extension."
End If
End If
Next
'post resulting html to details element
Details.innerHTML = strDetails
End Sub
'****************************************************************************
'* Reset
'* reset the tool interface, also reloads the code (helpful for programming)
'****************************************************************************
Sub Reset
Location.Reload(True)
End Sub
</Script>
<!****************************************************************************>
<!* End Script / Begin HTML >
<!****************************************************************************>
<BODY>
<DIV id=bg>
<img src=winpe.bmp>
</DIV>
<DIV id=body></DIV>
<DIV id=details></DIV>
<DIV id=tools>
<Button id=ghost onclick=doTask('"t:\Programs\ghost11\files\ghost32.exe"')>Ghost</BUTTON>
<Button id=cmd onclick=doTask('%comspec%')> Cmd </BUTTON>
<Button id=notepad onclick=doTask('notepad')> Notepad </BUTTON>
<Button id=taskmgr onclick=doTask('taskmgr')> Taskmgr </BUTTON>
<Button id=close onclick=self.close()> Quit </BUTTON>
<Button id=reset onclick=reset> ResetApp </BUTTON>
<Button id=reboot onclick=self.navigate('reboot.hta')> Reboot </BUTTON>
</DIV>
</BODY>
</HTML>
<!****************************************************************************>
<!* End HTML >
<!****************************************************************************>
'find checked button
For Each Radio in Document.getElementsByName("radioList")
If Radio.Checked = True Then
'create imaging command line from button id
strTaskValue = Chr(34) & "t:\Programs\ghost11\files\ghost32.exe" & Chr(34) & " -clone,mode=load,src=" & Chr(34) & Radio.Id & ".gho" & Chr(34) & ",dst=1"
Posted 26 October 2007 - 04:59 AM
Posted 06 November 2007 - 03:04 PM
Posted 06 November 2007 - 03:07 PM
Posted 07 November 2007 - 02:51 PM
Posted 13 November 2007 - 02:54 PM
Posted 14 November 2007 - 06:52 AM
Posted 14 November 2007 - 02:03 PM
Posted 14 November 2007 - 03:17 PM
h1
{
font-family: Albertus Extra Bold;
font-size: 30;
color: #FFFFFF;
}
Posted 15 November 2007 - 03:21 PM
Posted 16 November 2007 - 07:53 AM
Posted 16 November 2007 - 10:45 PM
This post has been edited by KenKightly: 16 November 2007 - 11:35 PM
Posted 17 November 2007 - 12:12 AM
Posted 19 November 2007 - 12:35 PM
Posted 21 November 2007 - 02:41 AM
Posted 26 November 2007 - 03:12 AM
Posted 26 November 2007 - 09:26 AM
KenKightly, on Nov 21 2007, 03:41 AM, said:
Posted 26 November 2007 - 02:51 PM
Stratuscaster, on Nov 26 2007, 08:26 AM, said:
KenKightly, on Nov 21 2007, 03:41 AM, said: