Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   Dev Hardware ForumsSOFTWAREProgramming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Hardware Forums Sponsor:
  Trader Rating: 0 · #1  
Old April 24th, 2008, 04:51 AM
mdmini mdmini is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 2 mdmini User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 50 sec
Reputation Power: 0
DOS Batch - Batch file to compare folders and get result to another folder

can anyone help me with comparing files in 2 folders. i want to compare 2 folders and the difference between these two should go to another folder. any idea any one?

Reply With Quote
  Trader Rating: 1 · #2  
Old April 24th, 2008, 10:15 AM
weevilofdoom's Avatar
weevilofdoom weevilofdoom is offline
BLURG
Dev Hardware Loyal (3000 - 3499 posts)
 
Join Date: Sep 2004
Location: Oregon
Posts: 3,418 weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)  Folding Points: 32443 Folding Title: Starter FolderFolding Points: 32443 Folding Title: Starter Folder
Time spent in forums: 2 Months 21 h 7 m 44 sec
Reputation Power: 3311
Send a message via ICQ to weevilofdoom Send a message via AIM to weevilofdoom Send a message via MSN to weevilofdoom Send a message via Yahoo to weevilofdoom Send a message via Google Talk to weevilofdoom
Comments on this post
bob_man_uk agrees!
__________________

Reply With Quote
  Trader Rating: 0 · #3  
Old April 27th, 2008, 01:09 AM
mdmini mdmini is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 2 mdmini User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 50 sec
Reputation Power: 0
i got this:
@ECHO ON
SET LOCALFOLDER=C:\1
SET OTHERFOLDER=C:\2
:LOCALKEYTEMP

SET FILE=DONE
FOR /F "tokens=* delims=" %%G IN ('DIR ^%LOCALFOLDER%\*.*^') DO SET FILE=%%G
SET FULLPATHLOCAL="%LOCALFOLDER%\%FILE%"
SET FULLPATHOTHER="%OTHERFOLDER%\%FILE%"
SET FILE="%FILE%"
IF "DONE"==%FILE% GOTO END
ECHO N|COMP %FULLPATHLOCAL% %FULLPATHOTHER%
IF ERRORLEVEL 1 GOTO DIFFERENTKEYS
IF ERRORLEVEL 0 GOTO DELETEBOTH
ELETEBOTH
DEL /Q %FULLPATHLOCAL%
DEL /Q %FULLPATHOTHER%
GOTO LOCALKEYTEMP

IFFERENTKEYS
DEL /Q %FULLPATHLOCAL%
COPY FULLPATHOTHER C:\3 /S

GOTO LOCALKEYTEMP
:END
ECHO ALL FILES DELETED IN %LOCALFOLDER%
ECHO ALL NON IDENTICAL FILES REMAIN ON %OTHERFOLDER%
::xcopy C:\2\*.* C:\3 /S
CLS
EXIT

but this will not help me in moving the difference to new folder and the loop somehow doesnt' seem to work for more than one file..

Reply With Quote
  Trader Rating: 1 · #4  
Old April 28th, 2008, 10:29 AM
weevilofdoom's Avatar
weevilofdoom weevilofdoom is offline
BLURG
Dev Hardware Loyal (3000 - 3499 posts)
 
Join Date: Sep 2004
Location: Oregon
Posts: 3,418 weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)weevilofdoom User rank is General 35th Grade (Above 100000 Reputation Level)  Folding Points: 32443 Folding Title: Starter FolderFolding Points: 32443 Folding Title: Starter Folder
Time spent in forums: 2 Months 21 h 7 m 44 sec
Reputation Power: 3311
Send a message via ICQ to weevilofdoom Send a message via AIM to weevilofdoom Send a message via MSN to weevilofdoom Send a message via Yahoo to weevilofdoom Send a message via Google Talk to weevilofdoom
diff -u <dir1> <dir2> > <path to difference>/diff.txt

problem solved man...

Reply With Quote
Reply

Viewing: Dev Hardware ForumsSOFTWAREProgramming > DOS Batch - Batch file to compare folders and get result to another folder


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway