bobheart Posted August 21, 2004 Author Share Posted August 21, 2004 Ok both gave me errors ? would it be because I'm using unstable ? Link to comment Share on other sites More sharing options...
Lazycat Posted August 21, 2004 Share Posted August 21, 2004 Strange... I also use unstable (latest, from 19 august) and this works fine. Try to update to this - maybe this help Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
bobheart Posted August 21, 2004 Author Share Posted August 21, 2004 (edited) Ok here is the one that JdeB just did . I zip it up so you could look at it in a file .it is a au3 file http://12.22.230.41/MicroTech/Hosted/Files-D/backup3.zipRight after I pick the file to copy i get this error .---------------------------AutoIt Error---------------------------Line 6 (File "C:\Documents and Settings\bob\My Documents\backup3.au3"):$folder = FileSelectFolder("Choose a directory to backup to", @MyDocumentsDir)$folder = ^ ERRORError: Incorrect number of parameters in function call.---------------------------OK --------------------------- Edited August 21, 2004 by bobheart Link to comment Share on other sites More sharing options...
SlimShady Posted August 22, 2004 Share Posted August 22, 2004 Try this. $message = "Hold down Ctrl or Shift to choose multiple files." $files = FileOpenDialog($message, "C:\", "files (*.*)", 1 + 4 ) If @error Then Exit MsgBox(0,"","You chose " & $files & ".") $list = StringSplit($files, "|") $folder = FileSelectFolder("Choose a directory to backup to", "", 0) If @error Then MsgBox(4096,"","Backup cancelled.") Else MsgBox(4096,"","You chose " & $folder) EndIf For $i = 2 to $list[0] FileCopy($list[1] & "\" & $list[$i], $folder & "\" & $list[$i], 1) Next Link to comment Share on other sites More sharing options...
Developers Jos Posted August 22, 2004 Developers Share Posted August 22, 2004 Ok here is the one that JdeB just did . I zip it up so you could look at it in a file .it is a au3 file http://12.22.230.41/MicroTech/Hosted/Files-D/backup3.zip Right after I pick the file to copy i get this error . <{POST_SNAPBACK}>Runs fine with 3.0.102 and the latest build of 3.0.103.... What version are you running ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
bobheart Posted August 22, 2004 Author Share Posted August 22, 2004 3, 0, 102, 0 I just tried it again with no errors but no copy . $message = "Hold down Ctrl or Shift to choose multiple files." $files = FileOpenDialog($message, "C:\", "files (*.*)", 1 + 4 ) If @error Then Exit MsgBox(0,"","You chose " & $files & ".") $list = StringSplit($files, "|") $folder = FileSelectFolder("Choose a directory to backup to", "", 0) If @error Then MsgBox(4096,"","Backup cancelled.") Else MsgBox(4096,"","You chose " & $folder) EndIf For $i = 2 to $list[0] FileCopy($list[1] & "\" & $list[$i], $folder & "\" & $list[$i], 1) Next Link to comment Share on other sites More sharing options...
SlimShady Posted August 22, 2004 Share Posted August 22, 2004 (edited) 3, 0, 102, 0 I just tried it again with no errors but no copy . $message = "Hold down Ctrl or Shift to choose multiple files." $files = FileOpenDialog($message, "C:\", "files (*.*)", 1 + 4 ) If @error Then Exit MsgBox(0,"","You chose " & $files & ".") $list = StringSplit($files, "|") $folder = FileSelectFolder("Choose a directory to backup to", "", 0) If @error Then MsgBox(4096,"","Backup cancelled.") Else MsgBox(4096,"","You chose " & $folder) EndIf For $i = 2 to $list[0] FileCopy($list[1] & "\" & $list[$i], $folder & "\" & $list[$i], 1) Next <{POST_SNAPBACK}>Really strange. The code works perfect for me. After you choose the files and folder... Can you try to open the folder in explorer and press F5... And which Windows version are you using? Edited August 22, 2004 by SlimShady Link to comment Share on other sites More sharing options...
Somerset Posted August 22, 2004 Share Posted August 22, 2004 SlimShady i just tried your code, it copies multiple files just not single ones(one at a time)..... i am running windows 2000 an when coping from source folder was destopt to destination of my doctuments.... Link to comment Share on other sites More sharing options...
Somerset Posted August 22, 2004 Share Posted August 22, 2004 this script corrects the problem... it now copies single files, and multiple. give this a try bobheart $message = "Hold down Ctrl or Shift to choose multiple files." $files = FileOpenDialog($message, "C:\", "files (*.*)", 1 + 4 ) If @error Then Exit MsgBox(0,"","You chose " & $files & ".") $result = StringInStr($files, "|") if $result = 0 then Call ("single") else Call ("multipes") endif Func single() $folder = FileSelectFolder("Choose a directory to backup to", "", 0) If @error Then MsgBox(4096,"","Backup cancelled.") Else MsgBox(4096,"","You chose " & $folder) EndIf FileCopy($files, $folder, 1) Exit 0 EndFunc Func multipes() $list = StringSplit($files, "|") $folder = FileSelectFolder("Choose a directory to backup to", "", 0) If @error Then MsgBox(4096,"","Backup cancelled.") Else MsgBox(4096,"","You chose " & $folder) EndIf For $i = 2 to $list[0] FileCopy($list[1] & "\" & $list[$i], $folder & "\" & $list[$i], 1) Next Exit 0 EndFunc Link to comment Share on other sites More sharing options...
SlimShady Posted August 22, 2004 Share Posted August 22, 2004 (I had this post ready when the forum went down) SlimShady i just tried your code, it copies multiple files just not single ones(one at a time)..... i am running windows 2000 an when coping from source folder was destopt to destination of my doctuments.... <{POST_SNAPBACK}>Now it works when you select one file and when you select multiple files. $message = "Hold down Ctrl or Shift to choose multiple files." $files = FileOpenDialog($message, "C:\", "files (*.*)", 1 + 4 ) If @error Then Exit MsgBox(0,"","You chose " & $files & ".") $folder = FileSelectFolder("Choose a directory to backup to", "", 0) If @error Then MsgBox(4096,"","Backup cancelled.") Else MsgBox(4096,"","You chose " & $folder) EndIf If StringInStr($files, "|") >= 1 Then $list = StringSplit($files, "|") For $i = 2 to $list[0] FileCopy($list[1] & "\" & $list[$i], $folder & "\" & $list[$i], 1) Next Else FileCopy($files, $folder & "\", 1) EndIf Link to comment Share on other sites More sharing options...
Somerset Posted August 22, 2004 Share Posted August 22, 2004 Well i can say this we found two different but working ways around it... Yippie for us. Link to comment Share on other sites More sharing options...
bobheart Posted August 22, 2004 Author Share Posted August 22, 2004 (edited) The last two work fine thank you . Edited August 22, 2004 by bobheart Link to comment Share on other sites More sharing options...
bobheart Posted August 22, 2004 Author Share Posted August 22, 2004 How could you set it up so you could right click on a folder and use part of the program to copy/move that folder to some other drive etc ? This would be really nice for me as I download a lot of zipfiles so when I unzip them I could move the folders to a drive to keep safe . 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