Simple Copy and Paste Script

JakeFr

Estimable
Feb 28, 2015
1
0
4,510
Hi All,

First of all, I know this probably doesn't fit under a hardware forum but I'm sure that one of you pros would know if what I need is possible.

So I'm working on a very long document which would costs years for me to lose (a novel) and so I want it backed up/saved in multiple places.

I don't want a fancy backup solution as it is only one .docx that I care about but I would like for a script similar to this:

When shutting down or when booting up, copy file D:/Document/file.docx to C:/Documents/ - yes to overwrite

It would work great for if I'm working on the document from a USB and can have it copied locally automatically.

Also, if possible, maybe it could always keep a 'last version'

So:
1) Rename C:/Documents/file.docx to C:/Documents/File - last version.docx
2) Copy file D:/Document/file.docx to C:/Documents/

I would probably have it pasting to my OneDrive folder but I don't like to work straight from there as I've known issues in the past.

Any ideas?
 
Solution
Is the C and D drives separate or same drive but different partitions? If they are the same drive, you will want to save the file to a totally different disk.

Just a simple copy command in a .bat file will do this.

Create a text document and rename it to a .bat, put the copy command into it, save it and stick it in the Startup folder in the Start menu.

Copy "C:\xxxxx\xxxx\xxxxx.docx" "D:\xxxxx\xxxxx\xxxx_%date:~4,2%_%date:~7,2%_%date:~10,4%.docx" /Y


Is the C and D drives separate or same drive but different partitions? If they are the same drive, you will want to save the file to a totally different disk.

Just a simple copy command in a .bat file will do this.

Create a text document and rename it to a .bat, put the copy command into it, save it and stick it in the Startup folder in the Start menu.

Copy "C:\xxxxx\xxxx\xxxxx.docx" "D:\xxxxx\xxxxx\xxxx_%date:~4,2%_%date:~7,2%_%date:~10,4%.docx" /Y


 
Solution