Jump to content
Sign in to follow this  
earl82

GUI and Windows 7 Audit Mode

Recommended Posts

Hi,

has anyone had this problem?

I have made a GUI to help setup new systems for sale. When i boot the new system into audit mode and use my GUI, i have a button that runs a .cmd/.bat file that copies a answer file to the sysprep folder. The thing is that when i use the GUI it will not copy the file, but if i run the file by hand it works fine. My question is why will it not work with my GUI? It only has this issue with coping a file.

Here is my gui

;This creates the varibles required for the proccess
$RUNWin7Home = "start COPYHOME.CMD" ; Var for preparing the HDD for imageing
$RUNWin7Pro = "start COPYPRO.CMD" ; Var for running LCC Custom Windows Setup
$RUNSysprepFolder = "start SYSPREPFOLDER.CMD" ; Var for Applying Image to HDD for IntelWin7Home64
$RUNKeyFinder = "start keyfinder.exe" ; Var for Applying Image to HDD for IntelWin7Pro64
$RUNRunSysprep = "start Startsysprep.cmd" ; Var for Capturing Image from HDD to Server IntelWin7Home64
;this the main GUI page
$width = 450
$height = 324
$Formmain = GuiCreate("New Build Sysprep Tool",450,324,@DesktopWidth/2 - $width/2, @DesktopHeight/2 - $height/2)
$wPos = WinGetPos($Formmain)
$Win7Home=GuiCtrlCreateButton("Win7 Home",28,72,90,33)
$Win7Pro=GuiCtrlCreateButton("Win7 Pro",28,118,90,33)
$SysprepFolder=GuiCtrlCreateButton("Sysprep Folder",28,164,90,33)
$KeyFinder=GuiCtrlCreateButton("Key Finder",28,210,90,33)
$RunSysprep=GuiCtrlCreateButton("Run Sysprep",28,256,90,33)
$label1=GuiCtrlCreateLabel("New Build Sysprep Tool",84,15,400,50)
GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
$label2=GuiCtrlCreateLabel("Puts Answer File In Sysprep Folder",129,72,300,100)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$label3=GuiCtrlCreateLabel("Puts Answer File In Sysprep Folder",129,118,300,100)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$label4=GuiCtrlCreateLabel("Opens Sysprep Folder",129,164,300,100)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$label5=GuiCtrlCreateLabel("Finds Windows Key",129,210,300,100)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$label6=GuiCtrlCreateLabel("Runs Sysprep",129,256,300,100)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GuiSetState(@SW_SHOW)
While 1
$msg=GuiGetMsg()
If $msg=-3 Then Exit
If $msg=$Win7Home Then Win7Home()
If $msg=$Win7Pro Then Win7Pro()
If $msg=$SysprepFolder Then SysprepFolder()
If $msg=$KeyFinder Then KeyFinder()
If $msg=$RunSysprep Then RunSysprep()
Wend

Func Win7Home()
Run(@ComSpec & " /c " & $RUNWin7Home, "", @SW_HIDE)
EndFunc
Func Win7Pro()
Run(@ComSpec & " /c " & $RUNWin7Pro, "", @SW_HIDE)
EndFunc
Func SysprepFolder()
Run(@ComSpec & " /c " & $RUNSysprepFolder, "", @SW_HIDE)
EndFunc
Func KeyFinder()
Run(@ComSpec & " /c " & $RUNKeyFinder, "", @SW_HIDE)
EndFunc
Func RunSysprep()
Run(@ComSpec & " /c " & $RUNRunSysprep, "", @SW_HIDE)
EndFunc

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...