Gtek Posted March 13, 2014 Share Posted March 13, 2014 Hi thanks in advance Can one of you hardcore guys see way may script go's wrong. it's my $input i can't get to continue and insert it in the Run line. I have use the line $rc=_rundos 3 years ago and it worked whit the $input line, but alot have change . i'm no big programer so i tryed this. expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) Global $ExitID, $input _Main() Func _Main() Local $imagesID, $installID GUICreate("Fineman Imaging", 310, 80) GUICtrlCreateLabel("Please select a action!", 10, 10) $ImagesID = GUICtrlCreateButton("Images", 10, 50, 50, 20) GUICtrlSetOnEvent($imagesID, "OnYes") $installID = GUICtrlCreateButton("Install", 80, 50, 50, 20) GUICtrlSetOnEvent($installID, "OnNo") $ExitID = GUICtrlCreateButton("Exit", 150, 50, 50, 20) GUICtrlSetOnEvent($ExitID, "OnExit") GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit") GUISetState() ; display the GUI While 1 Sleep(1000) WEnd EndFunc ;==>_Main ;--------------- Functions --------------- Func OnYes() DriveMapAdd("y:", "\\10.0.1.17\public\teknik_images\ibase", 0) Local $iLoop = 1 While $iLoop = 1 $input = InputBox("Image name", "Enter path and file name") If @error = 1 Then MsgBox(4096, "Error", "You pressed 'Cancel' - try again!") Else if $input = FileExists("y:\'& $input'.gho") Then Else $iLoop = 0 EndIf EndIf WEnd Run(@ComSpec & " /C " & 'Ghost64.exe -clone,mode=restore,src=\\10.0.1.17\public\teknik_images\ibase\'& $input'.gho,dst=1 -sure -auto',"") If @error = 0 Then MsgBox(4096, "Error", "error") EndIf drivemapdel ("Y:") EndFunc ;==>OnYes to image Func OnNo() DriveMapAdd("y:", "\\10.0.1.17\public\teknik_images\ibase", 0) $input = InputBox("Image install name", "Enter file name") If @error = 1 Then MsgBox(4096, "Error", "You pressed 'Cancel' - try again!") EndIf Run(@ComSpec & " /C " & 'Ghost64.exe -clone,mode=create,src=1,dst=\\10.0.1.17\public\teknik_images\ibase\'& $input' -sure -auto',"") If @error = 0 Then MsgBox(4096, "Error", "error") EndIf drivemapdel ("Y:") EndFunc ;==>OnNo Func OnExit() If @GUI_CtrlId = $ExitID Then MsgBox(64, "Exit", "Imaging Canceled") Else MsgBox(64, "Cancel", "Action Canceled") EndIf Exit EndFunc ;==>OnExit Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 13, 2014 Moderators Share Posted March 13, 2014 Just at a glance, I can see errors on lines 48 and 61. Your @ComSpec call is missing an & after $input. If you have the full version of AutoIt installed along with SciTE, you should really use CTRL+F5 to check syntax. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 13, 2014 Moderators Share Posted March 13, 2014 Gtek,Welcome to the AutoIt forum. In future could you please give more descriptive titles to your threads - needing help is why people post here, a brief idea of the problem you are trying to solve is more useful. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Gtek Posted March 13, 2014 Author Share Posted March 13, 2014 Hi M23 Thanks and i will do so. Hi jLogan3o13 Many thanks. no syntax error in line 48 and 61. that helped. New error: will test and get back for more help but so far Thanks again. Gtek Link to comment Share on other sites More sharing options...
Solution Gtek Posted March 14, 2014 Author Solution Share Posted March 14, 2014 Hi Guys Thanks my script is up and running. I use it with Winpe on a USB boot disk. Script: expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) Global $ExitID, $input _Main() Func _Main() Local $imagesID, $installID GUICreate("Imaging", 310, 80) GUICtrlCreateLabel("Please select a action!", 10, 10) $ImagesID = GUICtrlCreateButton("Images", 10, 50, 50, 20) GUICtrlSetOnEvent($imagesID, "OnYes") $installID = GUICtrlCreateButton("Install", 80, 50, 50, 20) GUICtrlSetOnEvent($installID, "OnNo") $ExitID = GUICtrlCreateButton("Exit", 150, 50, 50, 20) GUICtrlSetOnEvent($ExitID, "OnExit") GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit") GUISetState() ; display the GUI While 1 Sleep(1000) WEnd EndFunc ;==>_Main ;--------------- Functions --------------- Func OnYes() Local $iLoop = 1 While $iLoop = 1 $input = InputBox("Image name", "Enter path and file name") If @error = 1 Then MsgBox(4096, "Error", "You pressed 'Cancel' - try again!") Else if $input = FileExists("\\10.0.1.17\public\teknik_images\ibase\" & $input & ".gho") Then Else $iLoop = 0 EndIf EndIf WEnd EndFunc ;==>OnYes to image RunWait(@ComSpec & " /C " & 'Ghost64.exe -clone,mode=restore,src=\\10.0.1.17\public\teknik_images\ibase\'& $input & '.gho,dst=1 -sure -auto',"") Exit Func OnNo() $input = InputBox("Image install name", "Enter file name") If @error = 1 Then MsgBox(4096, "Error", "You pressed 'Cancel' - try again!") EndIf RunWait(@ComSpec & " /C " & 'Ghost64.exe -clone,mode=create,src=1,dst=\\10.0.1.17\public\teknik_images\ibase\'& $input & '.gho -sure -auto',"") Exit EndFunc ;==>OnNo Func OnExit() If @GUI_CtrlId = $ExitID Then MsgBox(64, "Exit", "Imaging Canceled") Else MsgBox(64, "Cancel", "Action Canceled") EndIf Exit EndFunc ;==>OnExit Gtek Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now