Sign in to follow this  
Followers 0
kevcox

DirCopy Not Copying All Folders

2 posts in this topic

I'm trying to creat a backup script that copies all files from one laptop to a USB drive then copies them back to the new laptop. When creating this script I'm having a problem with getting all the folders from the "My Documents" and "Desktop" folders to copy from the old laptop to the USB Drive. I've verified it is not a space issue, security issue or file lock issue.

I'm using SciTE4 AutoIt3 Version 1.77 on Windows XP Pro client.

I've tried the following three lines of code without any success...

RunWait(@COMSPEC & ' /c xcopy '&'"'&@MyDocumentsDir&'" '&'"'&$BackupFolder&'My Documents\'&'"'&' /E /K /Q /Y /R')

DirCopy(@DesktopDir, $BackupFolder&"Desktop", 1)

RunAsWait($UserName, @ComputerName, $Password, 0, DirCopy(@DesktopDir, $BackupFolder&"Desktop",1))

Thank you in advance,

kevcox

Share this post


Link to post
Share on other sites



I'm trying to creat a backup script that copies all files from one laptop to a USB drive then copies them back to the new laptop. When creating this script I'm having a problem with getting all the folders from the "My Documents" and "Desktop" folders to copy from the old laptop to the USB Drive. I've verified it is not a space issue, security issue or file lock issue.

I'm using SciTE4 AutoIt3 Version 1.77 on Windows XP Pro client.

I've tried the following three lines of code without any success...

RunWait(@COMSPEC & ' /c xcopy '&'"'&@MyDocumentsDir&'" '&'"'&$BackupFolder&'My Documents\'&'"'&' /E /K /Q /Y /R')

DirCopy(@DesktopDir, $BackupFolder&"Desktop", 1)

RunAsWait($UserName, @ComputerName, $Password, 0, DirCopy(@DesktopDir, $BackupFolder&"Desktop",1))

Thank you in advance,

kevcox

You haven't given us enough information to know if you've made a mistake in your code or not, but you have too many quotation marks I think and maybe missing backslashes.

I have had a lot of problems with DirCopy not working though I haven't investigated, and instead I use xcopy like this

;copy complete folder
DirCreate($FullPathToDestFolder)
RunWait('xcopy~' & '" & $FullFolderPathToCopy & '"~"' & $FullPathToDestFolder & '"', $FullFolderPathToCopy, @SW_SHOW);@SW_HIDE

OR

;copy only certain files
RunWait('xcopy~' & '" & $FullFolderPathToCopy & '\*.mp3'"~"' & $FullPathToDestFolder & '"~/E','',@SW_SHOW)

Where I have used ~ to show where a space should be.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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