i want to make an auto backup script for my office. i've do some research and finally get some light bulb, but the problem is that my code just work in Windows 7 and won't work in Windows XP. so how do i solve this?
Here is my code
echo off
setlocal enabledelayedexpansion
:FIND.BACKUP.DRIVE.LETTER
set start.dir=%systemdrive%
J:
%cls%
if not "%cd:~0,2%"=="%start.dir%" goto next
I:
%cls%
if not "%cd:~0,2%"=="%start.dir%" goto next
H:
%cls%
if not "%cd:~0,2%"=="%start.dir%" goto next
G:
%cls%
if not "%cd:~0,2%"=="%start.dir%" goto next
if "%cd:~0,2%"=="%start.dir%" (
echo WAITING FOR FLASH MEDIUM TO BE CONNECTED . . .
if exist "%windir%\system32\timeout.exe" timeout /t 1 /nobreak >nul
if not exist "%windir%\system32\timeout.exe" pause
goto FIND.FLASH.DRIVE.LETTER
)
:next
set start.hour=%time:~0,2%
set start.min=%time:~3,2%
REM FLASH.DRIVE IS THE FLASH DRIVE.
set flash.drive=%cd:~0,2%
set date="%date:~7,2%-%date:~4,2%-%date:~10,4%"
mkdir "%userprofile%\desktop\a\%date%"
xcopy "%flash.drive%\*.*" /s /c /d /e /h /i /r /y %userprofile%\desktop\a\%date%
if not exist %flash.drive% set /a total.time=((((%time:~0,2%-%start.hour%)... && echo Flash Drive has been in for !total.time! minutes. && Pause>nul
@pause
thanks