Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Новый участник


Сообщения: 45
Благодарности: 4

Профиль | Отправить PM | Цитировать


Почему-то не работает. Помогите пожалуйста.
Код: Выделить весь код
@Echo On

Set "BoxIn=c:\temp"
Set "BoxOut=c:\temp"

Set "Mask=sshot-20??-??-??-[??-??-??].png"

FOR /F "usebackq delims=" %%f IN (`Dir "%BoxIn%\%Mask%" /b /A:-D 2^>nul`) DO (
	FOR /F "usebackq tokens=3 delims= " %%d IN ('%%f') DO (
		If Not Exist "%BoxOut%\%%d" Md "%BoxOut%\%%d"
		Copy "%BoxIn%\%%f" "%BoxOut%\%%d\" >nul &&Del "%BoxIn%\%%f"
	)
)
pause >nul
Код: Выделить весь код
C:\>Set "BoxIn=c:\temp"

C:\>Set "BoxOut=c:\temp"

C:\>Set "Mask=sshot-20??-??-??-[??-??-??].png"

C:\>FOR /F "usebackq delims=" %f IN (`Dir "c:\temp\sshot-20??-??-??-[??-??-??].p
ng" /b /A:-D 2>nul`) DO (FOR /F "usebackq tokens=3 delims= " %d IN ('%f') DO (
If Not Exist "c:\temp\%d" Md "c:\temp\%d"
 Copy "c:\temp\%f" "c:\temp\%d\"   1>nul  && Del "c:\temp\%f"
) )

C:\>(FOR /F "usebackq tokens=3 delims= " %d IN ('sshot-2018-03-30-[11-20-56].png
') DO (
If Not Exist "c:\temp\%d" Md "c:\temp\%d"
 Copy "c:\temp\sshot-2018-03-30-[11-20-56].png" "c:\temp\%d\"   1>nul  && Del "c
:\temp\sshot-2018-03-30-[11-20-56].png"
) )

C:\>(FOR /F "usebackq tokens=3 delims= " %d IN ('sshot-2018-03-30-[11-20-57].png
') DO (
If Not Exist "c:\temp\%d" Md "c:\temp\%d"
 Copy "c:\temp\sshot-2018-03-30-[11-20-57].png" "c:\temp\%d\"   1>nul  && Del "c
:\temp\sshot-2018-03-30-[11-20-57].png"
) )

C:\>(FOR /F "usebackq tokens=3 delims= " %d IN ('sshot-2018-03-30-[11-20-58].png
') DO (
If Not Exist "c:\temp\%d" Md "c:\temp\%d"
 Copy "c:\temp\sshot-2018-03-30-[11-20-58].png" "c:\temp\%d\"   1>nul  && Del "c
:\temp\sshot-2018-03-30-[11-20-58].png"
) )

C:\>(FOR /F "usebackq tokens=3 delims= " %d IN ('sshot-2018-03-30-[11-20-59].png
') DO (
If Not Exist "c:\temp\%d" Md "c:\temp\%d"
 Copy "c:\temp\sshot-2018-03-30-[11-20-59].png" "c:\temp\%d\"   1>nul  && Del "c
:\temp\sshot-2018-03-30-[11-20-59].png"
) )

C:\>(FOR /F "usebackq tokens=3 delims= " %d IN ('sshot-2018-03-30-[11-21-01].png
') DO (
If Not Exist "c:\temp\%d" Md "c:\temp\%d"
 Copy "c:\temp\sshot-2018-03-30-[11-21-01].png" "c:\temp\%d\"   1>nul  && Del "c
:\temp\sshot-2018-03-30-[11-21-01].png"
) )

C:\>(FOR /F "usebackq tokens=3 delims= " %d IN ('sshot-2018-03-30-[11-21-02].png
') DO (
If Not Exist "c:\temp\%d" Md "c:\temp\%d"
 Copy "c:\temp\sshot-2018-03-30-[11-21-02].png" "c:\temp\%d\"   1>nul  && Del "c
:\temp\sshot-2018-03-30-[11-21-02].png"
) )

C:\>(FOR /F "usebackq tokens=3 delims= " %d IN ('sshot-2018-03-30-[11-21-03].png
') DO (
If Not Exist "c:\temp\%d" Md "c:\temp\%d"
 Copy "c:\temp\sshot-2018-03-30-[11-21-03].png" "c:\temp\%d\"   1>nul  && Del "c
:\temp\sshot-2018-03-30-[11-21-03].png"
) )

C:\>(FOR /F "usebackq tokens=3 delims= " %d IN ('sshot-2018-03-30-[11-21-04].png
') DO (
If Not Exist "c:\temp\%d" Md "c:\temp\%d"
 Copy "c:\temp\sshot-2018-03-30-[11-21-04].png" "c:\temp\%d\"   1>nul  && Del "c
:\temp\sshot-2018-03-30-[11-21-04].png"
) )

C:\>(FOR /F "usebackq tokens=3 delims= " %d IN ('sshot-2018-03-30-[11-21-05].png
') DO (
If Not Exist "c:\temp\%d" Md "c:\temp\%d"
 Copy "c:\temp\sshot-2018-03-30-[11-21-05].png" "c:\temp\%d\"   1>nul  && Del "c
:\temp\sshot-2018-03-30-[11-21-05].png"
) )

C:\>(FOR /F "usebackq tokens=3 delims= " %d IN ('sshot-2018-03-30-[11-21-07].png
') DO (
If Not Exist "c:\temp\%d" Md "c:\temp\%d"
 Copy "c:\temp\sshot-2018-03-30-[11-21-07].png" "c:\temp\%d\"   1>nul  && Del "c
:\temp\sshot-2018-03-30-[11-21-07].png"
) )

C:\>pause  1>nul
Код: Выделить весь код
Microsoft Windows [Version 6.1.7601]
(c) Корпорация Майкрософт (Microsoft Corp.), 2009. Все права защищены.

C:\Users\User>tree.exe c:\temp
c:\temp
|-- sshot-2018-03-30-[11-20-56].png
|-- sshot-2018-03-30-[11-20-57].png
|-- sshot-2018-03-30-[11-20-58].png
|-- sshot-2018-03-30-[11-20-59].png
|-- sshot-2018-03-30-[11-21-01].png
|-- sshot-2018-03-30-[11-21-02].png
|-- sshot-2018-03-30-[11-21-03].png
|-- sshot-2018-03-30-[11-21-04].png
|-- sshot-2018-03-30-[11-21-05].png
`-- sshot-2018-03-30-[11-21-07].png

0 directories, 10 files

C:\Users\User>

Последний раз редактировалось lSVl, 30-03-2018 в 10:37.


Отправлено: 09:50, 30-03-2018 | #13