Simple Copy and Paste Script

JakeFr

Estimable
Feb 28, 2015
1
0
4,510
0
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?
 

hang-the-9

Titan
Moderator
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


 

hang-the-9

Titan
Moderator
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


 
Thread starter Similar threads Forum Replies Date
S Apps General Discussion 5
A Apps General Discussion 2
P Apps General Discussion 2
G Apps General Discussion 0
gigaman Apps General Discussion 1
B Apps General Discussion 6
drjackool Apps General Discussion 5
G Apps General Discussion 4
S Apps General Discussion 2
Achint2000 Apps General Discussion 4
J Apps General Discussion 2
C Apps General Discussion 3
Pimpom Apps General Discussion 5
D Apps General Discussion 1
P Apps General Discussion 1
P Apps General Discussion 6
T Apps General Discussion 1
giantbucket Apps General Discussion 2
L Apps General Discussion 1
amdchuck Apps General Discussion 5

ASK THE COMMUNITY