Jump to content
Sign in to follow this  
am632

Cant get directory copy to work

Recommended Posts

am632

Hi, I am Trying to copy a directory with subfolders but i cant find anything that works, i have also tried the xcopy thing with no luck. heres a snippet of my code.

$Destination = (@ScriptDir & "\Backups\" & $backupname & $TodaysDate & $Time)

If @OSVersion = "Win_XP" then $setpicturesdir = (@DocumentsCommonDir & "\My Pictures") Else
    $setpicturesdir = (@UserProfileDir & "\Pictures")

DirCopy($setpicturesdir, $Destination & "\Pictures",1)

This worked but only copied files in the pictures folder and not other subfolders.

Whats the best way around this?

Thanks

Share this post


Link to post
Share on other sites
PsaltyDS

NVM - logic bug in my head!

;)

Edit: Missed the obvious! :blink:

Unless I'm getting different results than you, they are all there under the destination directory. In your case, there is only a $Destination & "\Pictures" directory, but under that will be all of them, including $Destination & "\Pictures\Pictures".

:P

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×