sbrady Posted November 21, 2012 Share Posted November 21, 2012 I am leaving work for the weekend but thought I would post this. I cannot get a directory to FULLY copy all contents across a network. I can make a folder and name it (not the AutoIT way I know). When this script runs, it gets the files from the "BUMPER" folder just fine, but every folder after that does NOT copy the contents. Any ideas from a kind soul would be appreciated. expandcollapse popup#include #include Local $FileList = _FileListToArray("\\10.10.10.10\Incoming Projects DAW1\Promos\Open PM") For $i = 1 To $FileList[0] ; As explained the [0] element holds the count If StringInStr($FileList[$i], "Bumpers EXPORTS") Then ; Does the name hold the string "Promo"? $export_folder1 = $FileList[$i] $dest = "C:\Documents and Settings\sebrad\Desktop\Open PM3\" DirCreate ( $dest & $export_folder1 ) EndIf If StringInStr($FileList[$i], "NDP EXPORTS") Then ; Does the name hold the string "Promo"? $export_folder2 = $FileList[$i] $dest = "C:\Documents and Settings\sebrad\Desktop\Open PM3\" DirCreate ( $dest & $export_folder2 ) EndIf If StringInStr($FileList[$i], "OPEN EXPORTS") Then ; Does the name hold the string "Promo"? $export_folder3 = $FileList[$i] $dest = "C:\Documents and Settings\sebrad\Desktop\Open PM3\" DirCreate ( $dest & $export_folder3 ) EndIf ;======================================== If StringInStr($FileList[$i], "Bumpers EXPORTS") Then ; Does the name hold the string "Promo"? $source1 = "\\10.10.44.37\Incoming Projects DAW1\Promos\Open PM\" $export_folder1 = $FileList[$i] $dest = "C:\Documents and Settings\sebrad\Desktop\Open PM3\" MsgBox(8192, "Bumper", $source1 & $export_folder1) DirCopy ($source1 & $export_folder1,$dest & $export_folder1,1 ) EndIf If StringInStr($FileList[$i], "NDP EXPORTS") Then ; Does the name hold the string "Promo"? $source1 = "\\10.10.44.37\Incoming Projects DAW1\Promos\Open PM\" $export_folder2 = $FileList[$i] $dest = "C:\Documents and Settings\sebrad\Desktop\Open PM3\" MsgBox(8192, "NPR", $source1 & $export_folder2) DirCopy (($source1 & $export_folder2),($dest & $export_folder2),1 ) EndIf If StringInStr($FileList[$i], "OPEN EXPORTS") Then ; Does the name hold the string "Promo"? $source1 = "\\10.10.44.37\Incoming Projects DAW1\Promos\Open PM\" $export_folder3 = $FileList[$i] $dest = "C:\Documents and Settings\sebrad\Desktop\Open PM3\" MsgBox(8192, "OPEN", $source1 & $export_folder3) DirCopy (($source1 & $export_folder3),($dest & $export_folder3),1 ) EndIf Next Link to comment Share on other sites More sharing options...
kylomas Posted November 21, 2012 Share Posted November 21, 2012 (edited) sbrady,Is $dest supposed to point at the same resource?kylomasedit : you might also want to look at dircopy and you should check return codes from your function callsedit2 : Disregard...just put my glasses back on, duh!! Edited November 21, 2012 by kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
iamtheky Posted November 21, 2012 Share Posted November 21, 2012 Dont know if this is the cause, but the Dircopy commands in the other two have an extra set of parentheses... ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
kylomas Posted November 21, 2012 Share Posted November 21, 2012 @boththose, The parens are balanced but the syntax seems odd...not sure why he has the inner parens kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
kylomas Posted November 21, 2012 Share Posted November 21, 2012 (edited) Odd as it looks, when I run this dircopy ( (@desktopdir & 'ai temp'), (@DesktopDir & 'ai temp2'),1) it runs successfully. The problem lies elsewhere. @sbrady - have you verified that $filelist contains what you expect? kylomas Edited November 21, 2012 by kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
sbrady Posted November 21, 2012 Author Share Posted November 21, 2012 kylomas, yes, I did put in a MSG line of code and it gave me the name of the source folder for each variable. what I wrote does copy the contents of the BUMPER folder, the NPR folder an OPEN folder DO NOT get copied. I dont see a progress bar when something is getting copied, is there a way I can show a progress bar so I can see what is getting copied. If I bypass the BUMPER copy, then BOTH NPR and OPEN folders get copied. I am asking this script to do too much at once. Whats getting copied is an HD video file and some audio files. Maybe I need to slow things down. How can I verify a copy command was completed and if not, then tell it to do it again. thanks for your kind replies. 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