We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Writing a Batch File?
Money_Saver
Posts: 364 Forumite
in Techie Stuff
My knowledge is limited but wanted to ask:
Am I correct in thinking that you can write a batch file to copy all my docs from my docs to an external hard drive with just a click of a shortcut on my desktop? I am running windows 7.
If so, how do I go about doing this...and It would be great if the command would request to overwrite and previous filess with the same name.
Many many thanks for your help.
Am I correct in thinking that you can write a batch file to copy all my docs from my docs to an external hard drive with just a click of a shortcut on my desktop? I am running windows 7.
If so, how do I go about doing this...and It would be great if the command would request to overwrite and previous filess with the same name.
Many many thanks for your help.
Regards,
Money Saver
Money Saver
0
Comments
-
You just need to use xcopy, something like the following:
xcopy c:\documents and settings\username e:\backup /s/e/v/c/i/y
Just stick this line into a text file and call it backup.bat or similar.
I think on some versions of windows, Microsoft has now replaced xcopy with robocopy, so if xcopy doesn't work, try using robocopy instead. The flags at the end do the following;
/s = copy subdirectories
/e = copy empty subdirectories
/v = verify copied files
/c = continue on error
/i = assume destination is a directory
/y = suppress prompting for overwriting existing file0 -
It can be done with a batch file if you have some sort of understanding of good old DOS. You'd have to be pre-windows days for that.;)
Basically you would use the xcopy command, something like:
xcopy source destination /S/Y
The /S switch tells it to include subdirectories and /Y tells it not to ask if overwriting existing files on the destination.
Your source and destination would be the main parent directory you are copying from or to.
You'd put that command into a text file with a .bat extension on your local drive and then create a shortcut to it on your desktop.
In all probability you'd want to be a lot more sophisticated than just that command alone offers, but it would be a start.I’m a Forum Ambassador and I support the Forum Team on the In My Home MoneySaving, Energy and Techie Stuff boards. If you need any help on these boards, do let me know. Please note that Ambassadors are not moderators. Any posts you spot in breach of the Forum Rules should be reported via the report button, or by emailing forumteam@moneysavingexpert.com.
All views are my own and not the official line of MoneySavingExpert.
0 -
I have an external drive and I just drag whatever from the C: hardrive over to the external.0
-
Change the name, it gives you that option.0
-
-
Or you could use Microsoft Sync Toy .4.8kWp 12x400W Longhi 9.6 kWh battery Giv-hy 5.0 Inverter, WSW facing Essex . Aint no sunshine ☀️ Octopus gas fixed dec 24 @ 5.74 tracker again+ Octopus Intelligent Flux leccy0
-
You could make a folder on the external drive with the date then drag all that days files over to it, then the next time do another folder this may also make it easier to find a file plus you know when you did it for future reference.0
-
You just need to use xcopy, something like the following:
xcopy c:\documents and settings\username e:\backup /s/e/v/c/i/y
Just stick this line into a text file and call it backup.bat or similar.
I think on some versions of windows, Microsoft has now replaced xcopy with robocopy, so if xcopy doesn't work, try using robocopy instead. The flags at the end do the following;
/s = copy subdirectories
/e = copy empty subdirectories
/v = verify copied files
/c = continue on error
/i = assume destination is a directory
/y = suppress prompting for overwriting existing file
YAY!!! It worked! thanks so much!Regards,
Money Saver0
This discussion has been closed.
Confirm your email address to Create Threads and Reply
Categories
- All Categories
- 352.3K Banking & Borrowing
- 253.6K Reduce Debt & Boost Income
- 454.3K Spending & Discounts
- 245.3K Work, Benefits & Business
- 601.1K Mortgages, Homes & Bills
- 177.5K Life & Family
- 259.2K Travel & Transport
- 1.5M Hobbies & Leisure
- 16K Discuss & Feedback
- 37.7K Read-Only Boards
