|
Answer» Is there a way in "XP's DOS-CMD-BATCH" to check a specific removable storage drive for data in it, and if it doesn't find anything or detect the drive as being active have it then proceed to RENAME a specified folder with a time-stamp-date...
I found this site for time-stamping a folder in MS-DOS: http://talk.bmc.com/blogs/blog-gentle/anne-gentle/dos-timestamp-tips
This is my "BATCH SCRIPT APP" I'm making.. -------------------------------------------------------------------------
:UP
tasklist | find /i "R-copy-1.exe" && goto SKIP-1 start %MYFILES%\hstart.exe /nowindow "%MYFILES%\R-copy-1.exe E: C:\0\E\1 /XX /mir /r:0" Check E: for data, if no data found then goto TIME-STAMP :TIME-STAMP set hh=%time:~0,2% if "%time:~0,1%"==" " set hh=0%hh:~1,1% set yymmdd_hhmmss=%date:~12,2%%date:~4,2%%date:~7,2%_%hh%%time:~3,2%%time:~6,2% REN C:\0\E\1 %yymmdd_hhmmss% :SKIP-1
tasklist | find /i "R-copy-2.exe" && goto SKIP-2 start %MYFILES%\hstart.exe /nowindow "%MYFILES%\R-copy-2.exe F: C:\0\F\1 /XX /mir /r:0" Check F: for data, if no data found then goto TIME-STAMP :TIME-STAMP set hh=%time:~0,2% if "%time:~0,1%"==" " set hh=0%hh:~1,1% set yymmdd_hhmmss=%date:~12,2%%date:~4,2%%date:~7,2%_%hh%%time:~3,2%%time:~6,2% REN C:\0\F\1 %yymmdd_hhmmss% :SKIP-2
tasklist | find /i "R-copy-3.exe" && goto SKIP-3 start %MYFILES%\hstart.exe /nowindow "%MYFILES%\R-copy-3.exe G: C:\0\G\1 /XX /mir /r:0" Check G: for data, if no data found then goto TIME-STAMP :TIME-STAMP set hh=%time:~0,2% if "%time:~0,1%"==" " set hh=0%hh:~1,1% set yymmdd_hhmmss=%date:~12,2%%date:~4,2%%date:~7,2%_%hh%%time:~3,2%%time:~6,2% REN C:\0\G\1 %yymmdd_hhmmss% :SKIP-3
cls GOTO UP
------------------------------------------------------------------
BASICALLY it runs in a constant infinite loop checking for Removable Storage Devices that are plugged into my PC. then once it detects a "RSD" it procedes to copy its entire contents onto my HDD in a specified folder using the assistance of the ROBOCOPY.exe FILE--> http://www.ss64.com/nt/robocopy.html
so after the "RS-Device" is unplugged from my PC, I want my "BATCH SCRIPT APP" to check that drive it just copied the files from, to see if the "RS-Device" is still plugged in, and if its not plugged in then it can proceed to rename the folder with the copied files with a time-stamp-date..
IS this possible at all to do what im asking here..?? or am I SOL...
|