Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch file for backup 1

Status
Not open for further replies.

LMichel

IS-IT--Management
Joined
Apr 2, 2001
Messages
85
Location
BE
Has someone a batch file that makes a copy from one directory to an other. Target directory is fonction of the day of the week. Source directory is always the same.
 
This one creates a folder named for the date. You can add what you need to do the copy.
Code:
@Echo off
setlocal
for /f "tokens=2 delims=/ " %%i in ('date /t') do set MONTH=%%i
for /f "tokens=3 delims=/ " %%i in ('date /t') do set DAY=%%i
for /f "tokens=4 delims=/ " %%i in ('date /t') do set YEAR=%%i

set FOLDER=%YEAR%-%MONTH%-%DAY%
md %FOLDER%
endlocal

Jeff

I haven't lost my mind - I know it's backed up on tape somewhere ....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top