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 

Копирование даты/времени

 
Post new topic   Reply to topic    Total Commander Forum Index -> Автоматизация Total Commander printer-friendly view
View previous topic :: View next topic  
Author Message
Вахмурка



Joined: 27 Dec 2004
Posts: 2584
Location: Большая деревня Москва

Post (Separately) Posted: 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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Автоматизация Total Commander All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group