Sign in to follow this  
Followers 0
sbrady

how to copy a director

6 posts in this topic

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.

#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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

sbrady,

Is $dest supposed to point at the same resource?

kylomas

edit : you might also want to look at dircopy and you should check return codes from your function calls

edit2 : Disregard...just put my glasses back on, duh!!

Edited 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

Share this post


Link to post
Share on other sites

Dont know if this is the cause, but the Dircopy commands in the other two have an extra set of parentheses...


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0