Batch script
Closed
guru
-
May 30, 2010 at 01:44 AM
Richard.Williams Posts 25 Registration date Saturday November 7, 2009 Status Member Last seen July 18, 2012 - Jun 13, 2010 at 01:21 PM
Richard.Williams Posts 25 Registration date Saturday November 7, 2009 Status Member Last seen July 18, 2012 - Jun 13, 2010 at 01:21 PM
Related:
- Batch script
- Ping batch file output to text - Guide
- Batch rotate images - Guide
- Anu script manager 7.0 free download filehippo ✓ - Excel Forum
- Script - Software Forum
- Ubuntu shutdown script - Guide
3 responses
Richard.Williams
Posts
25
Registration date
Saturday November 7, 2009
Status
Member
Last seen
July 18, 2012
14
Jun 13, 2010 at 01:21 PM
Jun 13, 2010 at 01:21 PM
Use this script. (It will handle file names with spaces and other special characters.)
Script is in biterscripting. Save the script in file C:/Scripts/DetectDuplicate.txt, start biterscripting, enter this command.
It will report duplicate files in folders D:/folder1 and D:/folder2.
# Script DetectDuplicate.txt var string folder1, folder2 var string list1, list2, path2, file2 lf -n "*" $folder1 ($ftype=="f") > $list1 lf -n "*" $folder2 ($ftype=="f") > $list2 while ($list2 <> "") do lex "1" $list2 > $path2 stex "^/^l[" $path2 > $file2 if ( { sen ("^"+$file2+"^") $list1 } > 0 ) # Duplicate file - report to user. echo $folder1 "/" $file2 "\n" $folder2 "/" $file2 endif done
Script is in biterscripting. Save the script in file C:/Scripts/DetectDuplicate.txt, start biterscripting, enter this command.
script "C:/Scripts/DetectDuplicate.txt" folder1("D/folder1") folder2("D:/folder2")
It will report duplicate files in folders D:/folder1 and D:/folder2.
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
May 31, 2010 at 01:26 PM
May 31, 2010 at 01:26 PM
what you mean by "similar "
similar means same filenames.
I need filenames of same name from two different folders.This filenames should need on a textfile with exact path.And one more requirement is , i need filenames in following format -
For example - folder 1 has two files (file1,file2) in D ridve and folder2 has four files (file0,file1,file2,file3).in D drive.
The output should be as below on seraching file1 and file 2 in folder 1 and folder2 -
D:/folder1/file1
D:/folder2/file1
D:/folder1/file2
D:/folder2/file2
I need filenames of same name from two different folders.This filenames should need on a textfile with exact path.And one more requirement is , i need filenames in following format -
For example - folder 1 has two files (file1,file2) in D ridve and folder2 has four files (file0,file1,file2,file3).in D drive.
The output should be as below on seraching file1 and file 2 in folder 1 and folder2 -
D:/folder1/file1
D:/folder2/file1
D:/folder1/file2
D:/folder2/file2
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Jun 1, 2010 at 08:00 AM
Jun 1, 2010 at 08:00 AM
Does every thing has to be done in DOS script or can you import the dir listing of the two folders in an excel file and then separate out common files ?
gurusamy
Posts
1
Registration date
Thursday June 3, 2010
Status
Member
Last seen
June 3, 2010
Jun 3, 2010 at 09:55 AM
Jun 3, 2010 at 09:55 AM
ANything is fine for me.I need seperate common files in a textfile.Another additional requirement - even need different files listing of two folders.
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Jun 3, 2010 at 11:01 AM
Jun 3, 2010 at 11:01 AM
Could you please upload a a zip file with two directory listing on some shared site like https://authentification.site , http://wikisend.com/ etc and post back here the link to allow better understanding