Solved

How create script to backup 2 files to jump drive

Posted on 2012-03-26
4
288 Views
Last Modified: 2012-03-28
I have two files that I manually backup daily to a jump drive.  I'd like to write a script to do this by double-clicking an icon on my desktop but don't know how to do it.  I am using Windows 7.

One of the files is located at:
\\ServerName\FolderName\SubFolderName\FileName.mdb

and the other one is located at:
\\SameServerName\ADifferentFolderName\ADifferentSubFolderName\FileName.mdb

I want then both to backup to a folder on the jump drive named:
FileBackups

I'm new at this.  How can I accomplish this?

--Steve
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Geodash
ID: 37768117
an easy script would override the previous days backups.

Do you want to keep more than the previous days, or is it safe to backup only the previous days?
0
 
LVL 9

Accepted Solution

by:
Frank McCourry earned 500 total points
ID: 37768123
A simple batch file can accomplish this.  Be careful to insert your thumb drive in the same usb port every time, to avoid getting a different drive letter:

1. Create a text file and paste in the following, making adjustments for you environment:
========================================================================
xcopy \\ServerName\FolderName\SubFolderName\FileName.mdb f:\FileBackups /h /e /c/ k /y /f
xcopy \\SameServerName\ADifferentFolderName\ADifferentSubFolderName\FileName.mdb f:\FileBackups  /h /e /c/ k /y /f
========================================================================
2. save the text file as "backup.bat" or something similar.  the .bat is important.

This is assuming that your thumb drive is getting drive letter F:

I use xcopy because of the rich features and control.  This script is written as simply as possible and will overwrite any files on the destination with the same filename without warning.

For more info on xcopy, go to a command prompt and type xcopy /?
0
 

Author Comment

by:SteveL13
ID: 37774130
Hmmm.. is not working.  I double-click the .bat file and nothing gets written to the drive (drive e for my system).
0
 
LVL 9

Expert Comment

by:Frank McCourry
ID: 37774179
Make sure the drive or the folder is not write protected.  Also check that you have appropriate permissions.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Bad_Pool_Header 0x0000019 BSOD tho can boot in safe mode 18 109
Print to local printer - Windows 7 RDP 9 65
Desktop loading is delayed 38 80
Screen saver problem 6 24
So many times I have seen the words written in a question "if only I could show you" or " I know how hard it is for you since you can't see it" in any zone. That has inspired me to write about this tool in windows 7 called "Problem Steps Recorder…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question