Copying with command line

Avatar_5

Well-Known Member
Joined
Jan 10, 2008
Messages
223
Reaction score
0
Location
I can hear faint ooking in the distance..
I'm busy writing a script to backup some of my work in Python, and want to use the windows command line's copy function. Trouble is, it only copies the files in the source folder, not the folders in it and its contents. Can anyone help me get the command right, please? :confused:

The one I'm using at the moment:
Code:
copy /V /Y 'D:\source_folder' 'E:\Backup_folder'
 
Use C++, Use C++

VB is not bad either.

Its much easier for future purposes.
 
xcopy with a /s or /e parameter that does the job.

Side note - I used to use arj with the update parameter to keep backups, so you should be able to use the rar commandline, or use some other archiving program to do a similar job.
 
Last edited:
Use C++, Use C++

VB is not bad either.

Its much easier for future purposes.

Then I'd have to download a compiler first, remember how C++ works etc. :p Python is on hand and I'm ok with coding in it.

xcopy has a /s parameter that does the job.

Thanks very much, looks like it'll do the job very nicely.
 
Check out robocopy, part of the Windows resource toolkit. It can mirror directories, so delete from the destination if it's not in the source any more. Has all the standard copy functions etc as well. Vastly superior to the normal copy, surprised they don't include it by default.
 
Check out robocopy, part of the Windows resource toolkit. It can mirror directories, so delete from the destination if it's not in the source any more. Has all the standard copy functions etc as well. Vastly superior to the normal copy, surprised they don't include it by default.

That sounds very useful, I'll check it out when I have intl access again. My script is up and running now, thanks to you guys! :cool: Thank you!
 
just a thought ...

I'm busy writing a script to backup some of my work in Python, and want to use the windows command line's copy function.

Not what you are asking but, why not try to write you backup script it Python ?

... have a look at shutil API: http://docs.python.org/library/shutil.html

Edit: oops, only saw now that your problem is already solved (.. and don't have int. access atm)
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X