?
Solved

How create script to backup 2 files to jump drive

Posted on 2012-03-26
4
Medium Priority
?
291 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 2000 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

First some basics on Windows 7 Backup.  It has 2 components one is a file based backup which is stored in .zip files each zip is split at around 200 Megabytes and there is the Image Backup which is as the name implies a total image of the partition …
OfficeMate Freezes on login or does not load after login credentials are input.
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…
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

762 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