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
Вахмурка



PostPosted: Sun Mar 20, 2005 00:13    Post subject: Копирование даты/времени Reply with quote

Нарыл замечательную прогу, которая присваивает время создания, изменения и доступа одного файла (источник) другому файлу (приемник). Впрочем, это всего лишь одна из ее функций. Берем тут http://stevemiller.net/apps (советую заглянуть, там много интересного). Называется touch.exe. Сваял два почти одинаковых батника, вызывающих touch.exe. Первый работает из командной строки:

CopyDate1panel.bat Источник Приемник

Второй присваивает текущему файлу времена файла в другой панели. Вешаем CopyDate2panels.bat на кнопку ТС, а в поле Parameters кнопки пишем

%P%N %T%M

Логика, может, непривычная: в ТС термином target panel называется как раз панель, противоположная текущей. Желающие могут просто поменять порядок параметров.

Иконку к кнопке можно взять отсюда: http://t-n-b.narod.ru/CopyDate.ico

Не забудьте прописать путь к touch.exe.

***


CopyDate1panel.bat

Code:

@echo off

:   Description:
:   Assign creation, modification & access times of file %1 to file %2

if -%1==- goto Miss2Param
if -%2==- goto Miss1Param

echo Source file %1:
touch.exe /v /c /m /a %1

echo.

echo Target file %2:
touch.exe /v /c /m /a %2

touch.exe /r %1 %2

echo After touching
echo Target file %2:
touch.exe /v /c /m /a %2

goto End

:Miss2Param

echo Missing TWO parameters!
goto Help

:Miss1Param

echo Missing ONE parameter!

:Help
echo.
echo Usage:
echo %0 SourceFile TargetFile

:End
pause



CopyDate2panels.bat

Code:

@echo off

:   Description:
:   Assign creation, modification & access times of file %1 to file %2
:   %1 = TargetFile (current panel)
:   %2 = SourceFile (other panel)

if -%1==- goto Miss2Param
if -%2==- goto Miss1Param

echo Source file %2:
touch.exe /v /c /m /a %2

echo.

echo Target file %1:
touch.exe /v /c /m /a %1

echo.

echo Creation, modification and access times of
echo file %2 will be assigned to file %1

pause

touch.exe /r %2 %1

echo After touching
echo Target file %1:
touch.exe /v /c /m /a %2

goto End

:Miss2Param

echo Missing TWO parameters!
goto Help

:Miss1Param

echo Missing ONE parameter!

:Help
echo.
echo Usage:
echo %0 SourceFile TargetFile

:End
View user's profile Send private message Send e-mail Visit poster's website


Powered by phpBB © 2001, 2005 phpBB Group