Компьютерный форум OSzone.net  

Компьютерный форум OSzone.net (http://forum.oszone.net/index.php)
-   Скриптовые языки администрирования Windows (http://forum.oszone.net/forumdisplay.php?f=102)
-   -   [решено] copy + (http://forum.oszone.net/showthread.php?t=253576)

crindlok 09-02-2013 15:36 2086336

copy +
 
делаю copy file1+file2+file3 newfile.txt
работает.

подскажите пожалуйста как не в ручную перечислять, а чтоб он объединил все файлы в текущей директории с исключением test.txt

Foreigner 09-02-2013 18:33 2086460

Код:

@echo off

for /f "tokens=*" %%i in ('dir /b *.txt') do (

    2>nul 1>result.tmp type result.txt
    if not "%%i"=="test.txt" copy result.tmp+"%%~i" result.txt

)

del result.tmp


zion87 09-02-2013 19:00 2086477

Код:

@Echo Off

Set new=newfile.txt
Set test=test.txt

For /f "Delims=*" %%i In ('Dir /b "*.txt" ^|Findstr /bev /c:%test%') Do Call :1 "%%i"
Goto:Eof
:1
Set first=%1
Copy %first% %new%
For /f "Delims=*" %%h In ('Dir /b "*.txt" ^|Findstr /bev /c:%test% /c:%first% /c:%new%') Do Call :2 "%%h"
Exit
:2
Copy %new% + %1


crindlok 10-02-2013 13:49 2087009

Большое спасибо ребят, сам не смог, а вы помогли!


Время: 15:08.

Время: 15:08.
© OSzone.net 2001-