Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: Как найти по одному файлу каждого типа 
Author Message
Tol!k



PostPosted: Wed Dec 23, 2009 00:38    Post subject: Reply with quote

Andrey_A, надеюсь, я понял тебя правильно.
В начале .cmd добавь/удали нужные буквы дисков.
Code:
@echo off &chcp 1251 >nul
setlocal enableextensions

title C:\
dir c: /a-d/b/s/oe >c:\_all_files.tmp
title D:\
dir d: /a-d/b/s/oe >>c:\_all_files.tmp
title E:\
dir e: /a-d/b/s/oe >>c:\_all_files.tmp

for /f "delims=" %%f in (c:\_all_files.tmp) do (
echo %%~xf: "%%f">> c:\_ext_files.tmp
)
sort c:\_ext_files.tmp /o c:\_sort_exts.tmp
del /q c:\_all_files.tmp &del /q c:\_ext_files.tmp

set "e=."
for /f "tokens=1,*" %%e in (c:\_sort_exts.tmp) do (
title .%%e &call :compare %%e %%f
)
del /q c:\_sort_exts.tmp &exit /b

:compare
if not "%e%"=="%1" (
echo %1 %2>> c:\_one_ext.txt
set "e=%1"
)
goto :eof

Исправлено


Last edited by Tol!k on Tue Feb 23, 2010 00:57; edited 1 time in total
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group