Search the Community
Showing results for tags 'running filecopy not working'.
-
Hello team, I have a simple script I am trying to write. Basically I have 2 buttons. I have 1 that copies a vbscript file to a temp directory and the other to run the script once its copied. I am not having any luck getting even just the file to copy over. I was wondering if someone can look at the script give me some pointers. I did a lot of reading in the help file and found that filecopy might work for this. In the windows command prompt I know cscript will run my vbscript file so I am trying to declare that to run under button2. Can anyone help me write this? TYIA #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #Include <String.au3> #Region ### START GUI section ### $Form1 = GUICreate("File Fixer", 414, 389, 2165, 271) GUISetBkColor(0x008080) ;this button should copy the vbs to the temp folder $Button1 = GUICtrlCreateButton("Copy to c:\Temp", 8, 72, 89, 25) $Label3 = GUICtrlCreateLabel("first name:", 8, 128, 58, 17) GUICtrlSetColor(-1, 0xFFFFFF) ;creating variable fname to hold hte first name $fname = GUICtrlCreateInput("", 80, 120, 81, 21) ;creating variable lname to hold hte last name $lname = GUICtrlCreateLabel("last name:", 8, 168, 60, 17) GUICtrlSetColor(-1, 0xFFFFFF) $OU = GUICtrlCreateInput("", 80, 160, 81, 21) ;should run the script once pressed $Button2 = GUICtrlCreateButton("Run Script", 80, 208, 121, 25) GUISetState(@SW_SHOW) #EndRegion ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $fname EndSwitch WEnd so from here I should be able to click button1 have it copy the a.vbs file to the temp using filecopy I am thinking then using button2 to take the input from fname and lname then run cscript via the cmd option and input that into the script Any help is greatly appreciated