Jump to content

gorbisloth

Members
  • Posts

    13
  • Joined

  • Last visited

Recent Profile Visitors

192 profile views

gorbisloth's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Well seems to be the firewall in WinPE that's causing the problem. Disabled that with "wpeutil disable firewall" and Ghost picked up without a problem. Going to do some further testing but that seems to have been the problem.
  2. I was thinking more of McAfee running on the server than in WinPE actually. It doesn't look like the Host Intrusion part is installed on the server anyway so not likely an issue.
  3. Working directory doesn't seem to matter. I've tried windowsdir, systemdir and tempdir. All come back with the same problem. Could McAfee be blocking this from running somehow? Like I said earlier if you run the ghost command from the command prompt it connects fine but if it's run from the AutoIT executable it doesn't work. Could McAfee, which is running on the server, see that the network requests are coming from the AutoIT executable and be blocking it?
  4. After some testing it appears that a working directory has to be specified. If that option is left out the command won't execute at all. The ghost command is in quotes. I've tried both single and double quotes and doesn't seem to matter which you use it does the same thing.
  5. The Ghost exe file is located in the system32 folder. Does it even need a working directory?
  6. I've written a script to handle imaging a Win7 machine with ghost. The script works up to the point where it attempts to contact the ghost server to connect to the session. It basically times out. Now the reason I'm looking for assistance from you instead of from Symantec is that if I run the exact same command from the command line it works perfectly. The command needed to connect to the Ghost session is "Ghost32.exe -CLONE,mode=restore,src=@MCc,dst=1 -sure". When this is entered from a WinPE prompt it starts Ghost, connects to the session and completes successfully. The line in my script that runs this command is: Runwait(@ComSpec & " /c "& "Ghost32.exe -CLONE,mode=restore,src=@MCc,dst=1 -sure",@WindowsDir,@SW_SHOW) Is there something wrong with my code that would cause this to not work when run from my script?
  7. Here is my whole script. It's intended for imaging Win7 machines. It will display a dialog window to input the computer name, which is prepopulated with the serial number of the pc, then a username and password of a user with domain add privileges. It will then make sure that all the fields have values then it will compare the passwords fields to insure they are identical. After that it kicks off the ghost imaging then once that's done it will update the sysprep file on the freshly imaged machine and restarts. The diskpart button well it wipes the hard drive so don't click on that. This is intended to be run from WinPE. Now it works perfectly just like this but I wanted the password checking to be real time. It would not kick off any action until the user clicks Ok. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $Sysprep = "C:WindowsPantherunattend.xml" Global $Flag = 1 Global $sIni = @TempDir & "TAG.ini" ServiceTag() #Region ### START Koda GUI section ### Form=c:userswhalmichdesktopscriptskodaformsnathans.kxf $Form1_ = GUICreate("Ghost Win7", 465, 320, -1, -1) GUICtrlCreateLabel("Enter Computer Name", 80, 80, 108, 17) $PCName = GUICtrlCreateInput(IniRead($sIni, 'HW Info', 'Service Tag', ''), 224, 80, 121, 21) GUICtrlCreateLabel("Enter Username", 80, 120, 80, 17) $User = GUICtrlCreateInput("", 224, 120, 121, 21) GUICtrlCreateLabel("Enter Password", 80, 160, 78, 17) $Password = GUICtrlCreateInput("", 224, 160, 121, 21, 0x0020) GUICtrlCreateLabel("Confirm Password", 80, 200, 88, 17) $ConfirmPassword = GUICtrlCreateInput("", 224, 200, 121, 21, 0x0020) $OKButton = GUICtrlCreateButton("Ok", 96, 240, 75, 25) $Diskpart = GUICtrlCreateButton("Diskpart", 296, 240, 57, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $OKButton GUISetState(@SW_Hide) If GUICtrlRead($PCName) = "" or GUICtrlRead($User) = "" or GUICtrlRead($Password) = "" Then MsgBox(16, "Error", "You must supply a value for each field!") GUISetState(@SW_SHOW) Else If GUICtrlRead($Password) == GUICtrlRead($ConfirmPassword) Then Runwait(@ComSpec & " /c "& "Ghost32.exe -CLONE,mode=restore,src=@MCc,dst=1 -sure",@WindowsDir,@SW_SHOW) UpdateSysprep() RunWait(@ComSpec & ' /c ' & 'wpeutil Reboot') Exit Else MsgBox(16, "Invalid Password", "The password you typed does not match!") GUISetState(@SW_SHOW) EndIf EndIf Case $Diskpart DiskpartDrive() GUISetState(@SW_SHOW) EndSwitch WEnd Func UpdateSysprep() While $Flag = 1 $Text = FileRead($Sysprep,FileGetSize($Sysprep)) $Text = StringReplace($Text, "%ComputerName%", GUICtrlRead($PCname)) $Text = StringReplace($Text, "%UserName%", GUICtrlRead($User)) $Text = StringReplace($Text, "%Password%", GUICtrlRead($Password)) FileDelete($Sysprep) FileWrite($Sysprep,$Text) FileClose($Sysprep) $Flag = 0 Wend EndFunc Func ServiceTag() $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $objWMIService = ObjGet("winmgmts:" & $strComputer & "rootCIMV2") $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_ComputerSystemProduct", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) For $objItem In $colItems IniWrite($sIni, "HW Info", "Service Tag", $objItem.IdentifyingNumber) Next EndFunc Func DiskpartDrive() GUISetState(@SW_HIDE) $ConfirmDP = MsgBox(4, "Clean Disk 0", "This will clean disk 0 and create a new partition." & @CRLF & "You should remove any external drives just to be safe."& @CRLF & "" & @CRLF & "Are you sure you want to continue?") If $ConfirmDP = 7 Then Else $DPCommands = @TempDir & "dpcommands.txt" FileWriteLine($dpcommands, "select disk 0") FileWriteLine($dpcommands, "clean") FileWriteLine($dpcommands, "create partition primary") FileWriteLine($dpcommands, "select partition 1") FileWriteLine($dpcommands, "active") FileWriteLine($dpcommands, "assign") RunWait(@ComSpec & ' /c diskpart /s ' & $DPCommands) MsgBox(0, "Complete", "Diskpart Completed.", 5) FileDelete($DPCommands) EndIf EndFunc
  8. Ideally when they both match. That's the thing I can't figure out how to do this as the user types their password and not after they click Ok to go on.
  9. Thanks for the suggestion Water but I was hoping for something that didn't require any interaction from the user. An on the fly comparison if you will. I think I might have to just go with the error checking when they click the OK box.
  10. This is just the GUI I was using to test this with. It's going to be part of a larger script if I can get it to work. My biggest problem is trying to figure out how to keep this compare routine continuous. I'd like for the icon to change real time as the user types. When the user types in the password in input1 the icon at the end of input2 indicates they don't match. Once the user confirms the password the icon changes. I'd also like it if it would go back to the stop.ico if they change the password fields at some point. I've tried some if then statements to compare the values, and even some loops, do while and the like. #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $PWStatus = "stop.ico" #Region ### START Koda GUI section ### Form=C:UserswhalmichDesktopScriptsKodaFormsPWConfirm.kxf $Form1 = GUICreate("Form1", 615, 440, -1, -1) $Input1 = GUICtrlCreateInput("", 232, 176, 177, 21, 0x0020) GUICtrlCreateLabel("Password", 96, 176, 50, 17) $Input2 = GUICtrlCreateInput("", 232, 224, 177, 21, 0x0020) GUICtrlCreateLabel("Confirm Password", 96, 224, 88, 17) $Icon1 = GUICtrlCreateIcon($PWStatus, -1, 432, 224, 25, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
  11. I've looked and looked and can't find anything about this or a way to do it. All I want is to be able to compare two GUI input boxes and when they match have an ICON displayed at the end of the confirm box showing that they do indeed match. All my ideas on how to do it fail miserably. Is this something that's possible with AutoIT? I've seen it done with vbscript and an hta gui but I can't find anything on how to do it with AutoIT.
  12. Well that was simple. I don't understand why it worked the first time with the 0s though. And yea I didn't think that If line was necessary. Something left over from the script I copied the file edit code from. Thanks much appreciated.
  13. I'm working on a little program to update some info in the unattend xml file for doing Win7 installs. It's fairly simple, a pop up window prompts for the computer name, and the username, password for the account to add it to the domain. If the fields aren't blank it reads the current sysprep file and replaces the temporary text with the user input. If the fields are left blank it is supposed to just throw up an error window and exit. Right now my If statement is failing to acknowledge that there is any input in the fields so it's always dropping to the error window. I had it working earlier today but after trying to make some further adjustments to the script it stopped working. I can't figure out why it's not working. I'm getting values returned for the variables but it's saying I'm not. I'd like to figure out what I messed up. Also one other thing I'd like is if some of the fields are left blank i'd like it to leave the primary window open for the user to complete the form instead of just exiting. I'm sure there's a cleaner way of doing this but I'm new. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Sysprep = "C:\Windows\Panther\unattend.xml" Global $sIni = "c:\temp\TAG.ini" $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_ComputerSystemProduct", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) #Region ### START Koda GUI section ### Form=c:\users\whalmich\desktop\scripts\koda\forms\updatexmlinput.kxf $Form1_1 = GUICreate("Add to Domain Info", 576, 404, 209, 138) $PCName = GUICtrlCreateInput(IniRead($sIni, 'HW Info', 'Service Tag', ''), 256, 144, 121, 21) GUICtrlCreateLabel("Enter Computer Name", 112, 144, 108, 17) $User = GUICtrlCreateInput("", 256, 184, 121, 21) GUICtrlCreateLabel("Enter Username", 112, 184, 80, 17) $Password = GUICtrlCreateInput("", 256, 224, 121, 21, 0x0020) GUICtrlCreateLabel("Enter Password", 112, 224, 78, 17) $okbutton = GUICtrlCreateButton("Ok", 272, 336, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $okbutton If GUICtrlRead($PCName) = 0 or GUICtrlRead($User) = 0 or GUICtrlRead($Password) = 0 Then $Flag = 0 MsgBox(16, "Error", "You must supply a Computer Name, User Name and Password") Exit Else $Flag = 1 While $Flag = 1 If @error = -1 Then ExitLoop $Text = FileRead($Sysprep,FileGetSize($Sysprep)) $Text = StringReplace($Text, "%ComputerName%", GUICtrlRead($PCname)) $Text = StringReplace($Text, "%UserName%", GUICtrlRead($User)) $Text = StringReplace($Text, "%Password%", GUICtrlRead($Password)) FileDelete($Sysprep) FileWrite($Sysprep,$Text) FileClose($Sysprep) Exit Wend EndIf EndSwitch WEnd
×
×
  • Create New...