SumTingWong Posted September 15, 2005 Share Posted September 15, 2005 (edited) There is a way but it may not be easy.The inbuilt windows file copy dialog box can be called from your code and perform operations like file move and file copy.Unfortunately its not easy to implement this in AutoIt code and needs DllStruct and DllCall.Here is the MSDN link for SHFileOperation API function: http://msdn.microsoft.com/library/default....leoperation.aspAnd a VB tutorial for the same: http://vbnet.mvps.org/index.html?code/shel...rectorycopy.htm<{POST_SNAPBACK}>...got the t-shirt Edited September 15, 2005 by SumTingWong Link to comment Share on other sites More sharing options...
oleg Posted September 15, 2005 Author Share Posted September 15, 2005 SumTingWong Your code works great but i want to set the progress on the progress bar . How can i set the filename that actually being copied at label and the status at progress bar ? Here is some of my code $search = FileFindFirstFile($server&"\"&$share&"\"&$directory&"\"&$source&"\*.*") If $search = -1 Then MsgBox(01600262144, "Error", "Installation Files Not Found"&@CRLF&"Please Contact Employee") Exit EndIf $p = 0 $i = $size[1] DirCreate($destination) While $i >= 1 $file = FileFindNextFile($search) $p = ($i/$size[1])*100 $p = 103 - $p FileCopy ($server&"\"&$share&"\"&$directory&"\"&$source&"\"&$file , $destination ,1 ) If @error Then ExitLoop $i = $i - 1 GUICtrlSetData ($main_status,"Copying File :"&$file) GUICtrlSetData ($Main_Progress ,$p) If @error Then ExitLoop WEnd ; Close the search handle FileClose($search) There is a hex ( 31303030303030 ) reasons i love AutoIt ! Link to comment Share on other sites More sharing options...
seandisanti Posted September 15, 2005 Share Posted September 15, 2005 SumTingWong Your code works great but i want to set the progress on the progress bar .How can i set the filename that actually being copied at label and the status at progress bar ?Here is some of my code $search = FileFindFirstFile($server&"\"&$share&"\"&$directory&"\"&$source&"\*.*") If $search = -1 Then MsgBox(01600262144, "Error", "Installation Files Not Found"&@CRLF&"Please Contact Employee") Exit EndIf$p = 0$i = $size[1]DirCreate($destination)While $i >= 1 $file = FileFindNextFile($search) $p = ($i/$size[1])*100 $p = 103 - $p FileCopy ($server&"\"&$share&"\"&$directory&"\"&$source&"\"&$file , $destination ,1 ) If @error Then ExitLoop $i = $i - 1 GUICtrlSetData ($main_status,"Copying File :"&$file) GUICtrlSetData ($Main_Progress ,$p) If @error Then ExitLoopWEnd; Close the search handleFileClose($search)<{POST_SNAPBACK}>you're still using ctrlsetdata to update progress....check out in the helpfile: ProgressOn() ProgressOff() Progress Set() Link to comment Share on other sites More sharing options...
tonedeaf Posted September 16, 2005 Share Posted September 16, 2005 ...got the t-shirt <{POST_SNAPBACK}> Yes, very good....Thanks, I needed this script. 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