Comparing folder/sub-folder
Posted: 03 Nov 2010 02:45
Hi, sorry to disturb again, actually I really need this problem need to be solved urgently. I just wrote a batch program that comparing files which look like this:
set thumbdrive1="E:\Pendrive\PC Wizard Info\eGovt\eBIS-7 Notebook 185 Desktop\7 Notebook"
set harddisk1="C:\Pendrive\PC Wizard Info\eGovt\eBIS-7 Notebook 185 Desktop\7 Notebook"
set /p d1="Specify your source folder (pendrive): "
set /p d2="Specify your destination folder (harddisk): "
for /f "delims=" %%i in ('dir /b/a-d "%thumbdrive1%\%d1%\*" "%harddisk1%\%d2%\*"^|sort') do (
call set "$i=%%$i:%%i=%%"
if defined $i (
if not exist "%harddisk1%\%d2%\%%i" (echo :. +: %%i) else (
fc "%thumbdrive1%\d1%\%%i" "%harddisk1%\%d2%\%%i" >nul&& echo := =: %%i|| echo :^< ^>: %%i)))
set "$i=%%i"
)
When I run it, it prompted "there was an unexpected error )", what I don't understand is why the it cannot through sub-folder or do I have to change the coding again???? please need help here urgently????
set thumbdrive1="E:\Pendrive\PC Wizard Info\eGovt\eBIS-7 Notebook 185 Desktop\7 Notebook"
set harddisk1="C:\Pendrive\PC Wizard Info\eGovt\eBIS-7 Notebook 185 Desktop\7 Notebook"
set /p d1="Specify your source folder (pendrive): "
set /p d2="Specify your destination folder (harddisk): "
for /f "delims=" %%i in ('dir /b/a-d "%thumbdrive1%\%d1%\*" "%harddisk1%\%d2%\*"^|sort') do (
call set "$i=%%$i:%%i=%%"
if defined $i (
if not exist "%harddisk1%\%d2%\%%i" (echo :. +: %%i) else (
fc "%thumbdrive1%\d1%\%%i" "%harddisk1%\%d2%\%%i" >nul&& echo := =: %%i|| echo :^< ^>: %%i)))
set "$i=%%i"
)
When I run it, it prompted "there was an unexpected error )", what I don't understand is why the it cannot through sub-folder or do I have to change the coding again???? please need help here urgently????