Wishlist: set folder timestamp (like archive) to newest file

English support forum

Moderators: Hacker, petermad, Stefan2, white

User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

I know this is an oooooooooooold topic, but i ran into that problem, I searched the forum, and found this thread. But there is no easy solution, so I wrote my AutoHotkey script. Don't tell me, there is a solution by now, or I'll freak out :twisted:
As a side note, I agree, that this is one of the cases where AutoHotkey is maybe the least suitable choice for the solution (this is typically a batch file or VBScript task), but hey, for me AutoHotkey was the fastest solution ;-)
I switched to Linux, bye and thanks for all the fish!
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

Hey Partner,

seems as there is no inbuilt solution available so far.


Maybe you could add the solution for the oldest file, too?

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

2Sheepdog
Woa, that is nice, great work, van Dusen! How did I miss that, it happened just several days ago! Well, I'm not too active in the last month, am I. New job!
Thanks, Partner, see, I didnt search careful enough. The AHK script is definitely obsolete, maybe i will even delete it from the wiki. But then again... no ;-)
I switched to Linux, bye and thanks for all the fish!
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

2Sheepdog
Partner, can you send van Dusen's file to me? Rapidshare doesnt seem to work here...
I switched to Linux, bye and thanks for all the fish!
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

I tried to but your G-Mail rejected it. So I've sent you an downloadlink.

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
jjk
Member
Member
Posts: 181
Joined: 2003-07-03, 10:41 UTC

Post by *jjk »

Hello

I just discovered this topic, and I'm very interested by a tool to set folder timestamp (like archive) to newest file
Unfortunately the link http://rapidshare.de/files/18096705/SetFolderDate.zip.html to such a tool from Van Dusen is no longer available.

Can van Dusen or anyone else put that file here or mail to me ?

TIA very much

Jean-Jacques
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

2jjk
I just discovered this topic, and I'm very interested by a tool to set folder timestamp (like archive) to newest file
If you only want to set to the newest file, my script should be sufficient: http://www.ghisler.ch/wiki/index.php/AutoHotkey:_Set_folder_timestamp_to_newest_file
Sorry i dont have Van Dusen's script anymore... :oops:
I switched to Linux, bye and thanks for all the fish!
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

Here is the script

Code: Select all

;*** SetFolderDate.au3 (van Dusen, 15.04.2006)

#include <GUIConstants.au3>
AutoItSetOption("WinTitleMatchMode", 4)

Global $strYMDhmsMin, $strYMDhmsMax
Global $strYMDhmsMinFilename, $strYMDhmsMaxFilename

$frmGUI = GUICreate("Datum von Verzeichnissen ändern", 500, 340)
$grpDisplay = GUICtrlCreateGroup("Datum und Uhrzeit ändern", 10, 10, 480, 125)
$radioSetNewestDate = GUICtrlCreateRadio("das der neuesten Datei", 20, 30, 130, 20)
$radioSetOldestDate = GUICtrlCreateRadio("das der ältesten Datei", 20, 55, 130, 20)
GUICtrlSetState($radioSetOldestDate, $GUI_CHECKED)
$lblFileGetTimeRecurse = GUICtrlCreateLabel("}", 160, 29, 20, 60)
GUICtrlSetFont($lblFileGetTimeRecurse, 28)
$chkFileGetTimeRecurse = GUICtrlCreateCheckbox("Datumsangabe rekursiv ermitteln", 180, 43, 180, 20)
GUICtrlSetState($chkFileGetTimeRecurse, $GUI_CHECKED)
$chkSetFilespecDate = GUICtrlCreateCheckbox("das einer bestimmten Datei:", 20, 80, 150, 20)
$txtSetFilespecDate = GUICtrlCreateInput("", 180, 80, 200, 20)
$chkSetFilespecDateRegEx = GUICtrlCreateCheckbox("RegEx", 390, 80, 50, 20)
$radioSetUserdefDate = GUICtrlCreateRadio("ein bestimmtes:", 20, 105, 150, 20)
$txtSetUserdefDateDMY = GUICtrlCreateInput(@MDAY & "." & @MON & "." & @YEAR, 180, 105, 70, 20)
$txtSetUserdefDatehms = GUICtrlCreateInput(@HOUR & ":" & @MIN & ":" & @SEC, 255, 105, 60, 20)
$btnSetCurrentDate = GUICtrlCreateButton("Aktuelles", 320, 105, 60, 20)
GUICtrlCreateGroup ("", -99, -99, 1, 1)

$lstPreview = GUICtrlCreateListView("Verzeichnis                 |Datum bisher|Datum neu|Dateiname                 ", 10, 145, 480, 150)
;~ $lstPreview = GUICtrlCreateListView("Verzeichnis                 |Datum bisher|Datum neu|Dateiname                 ", 10, 145, 480, 150, $LVS_SHOWSELALWAYS+$LVS_SINGLESEL+$LVS_SORTASCENDING)

$btnCancel = GUICtrlCreateButton("Abbruch", 410, 305, 80, 25)
$btnOK = GUICtrlCreateButton("OK", 320, 305, 80, 25)
$btnPreview = GUICtrlCreateButton("Vorschau", 230, 305, 80, 25, $BS_DEFPUSHBUTTON)

;~ $lblStatus = GUICtrlCreateLabel("", 3, 337, 494, 20, $SS_SUNKEN)
$lblStatus = GUICtrlCreateLabel("", 10, 310, 200, 25)
GUICtrlSetColor($lblStatus, 0xFF0000)

$refresh = 0
$ct_dirs = 0

If WinExists("classname=TTOTAL_CMD") Then
		
	;*** cm_CopyFullNamesToClip=2018;Copy names with full path
	DllCall("user32.dll", "int", "PostMessage", "hwnd", WinGetHandle("classname=TTOTAL_CMD"), "int", 1075, "int", 2018)
	Sleep(200)
	;*** Meldung "Keine Dateien gewählt!"? Script ohne Ergebnis verlassen!
	If WinExists("classname=#32770", "Keine Dateien gewählt!") Then Exit
	
	;*** Einträge der Dateiliste aus Clipboard in Feld $tcpnl einlesen
	$tcpnl = StringSplit(ClipGet(), @CRLF, 1)
	;*** [0]=Index des ListViewItems; [1]=Verzeichnisname (kompletter Pfad); [2]=Verzeichnisname (nur letzte Pfadkomponente);
	;*** [3]=Bisheriges Datum; [4]=Neuestes Dateidatum; [5]=Ältestes Dateidatum; [6]=Name der Datei mit neuestem Datum; [7]=Name der Datei mit ältestem Datum
	;*** [8] = Neues Datum
	Dim $lstPreviewItem[$tcpnl[0]+1][9]
	
	GUISetState(@SW_SHOW, $frmGUI)
	
	For $i = 1 To $tcpnl[0]
		If StringRight($tcpnl[$i], 1) = "\" Then
			$ct_dirs = $ct_dirs + 1
			$lstPreviewItem[$i][1] = StringTrimRight($tcpnl[$i], 1)
			$lstPreviewItem[$i][2] = StringTrimLeft($lstPreviewItem[$i][1], StringInStr($lstPreviewItem[$i][1], "\", 0, -1))
			$lstPreviewItem[$i][3] = FileGetTime($lstPreviewItem[$i][1], 0, 1)
			$strYMDhmsMin = "99999999999999"
			$strYMDhmsMax = "00000000000000"
			_BtnDisable()
			_DirGetMinMaxFileTime($lstPreviewItem[$i][1])
			_BtnEnable()
			$lstPreviewItem[$i][4] = $strYMDhmsMax
			$lstPreviewItem[$i][5] = $strYMDhmsMin
			$lstPreviewItem[$i][6] = $strYMDhmsMaxFilename
			$lstPreviewItem[$i][7] = $strYMDhmsMinFilename
			$lstPreviewItem[$i][8] = $strYMDhmsMin
			$strPreviewItem = $lstPreviewItem[$i][2]
			$strPreviewItem = $strPreviewItem & "|" & _FmtDtTm($lstPreviewItem[$i][3])
			$strPreviewItem = $strPreviewItem & "|" & _FmtDtTm($lstPreviewItem[$i][5])
			$strPreviewItem = $strPreviewItem & "|" & $lstPreviewItem[$i][7]
			$lstPreviewItem[$i][0] = GUICtrlCreateListViewItem($strPreviewItem, $lstPreview)
			
		Else
			$lstPreviewItem[$i][1] = ""
			$lstPreviewItem[$i][2] = ""
			$lstPreviewItem[$i][3] = ""
			$lstPreviewItem[$i][4] = ""
			$lstPreviewItem[$i][5] = ""
			$lstPreviewItem[$i][6] = ""
			$lstPreviewItem[$i][7] = ""
			$lstPreviewItem[$i][8] = ""
			$lstPreviewItem[$i][0] = 0
			
		EndIf
	Next
	
	If $ct_dirs = 0 Then
		MsgBox(0, "SetFolderDate", "Keine Verzeichnisse gewählt!")
		GUIDelete($frmGUI)
		Exit
	EndIf
	
	GUICtrlSetData($grpDisplay, "Datum und Uhrzeit von " & $ct_dirs & " Verzeichnis(sen) ändern in")
	
	While 1
		
		$msg = GUIGetMsg()
		
		Select
			Case $msg = $GUI_EVENT_CLOSE Or $msg = $btnCancel
				GUIDelete($frmGUI)
				Exit
				
			Case $msg = $btnSetCurrentDate
				GUICtrlSetState($radioSetNewestDate, $GUI_UNCHECKED)
				GUICtrlSetState($radioSetOldestDate, $GUI_UNCHECKED)
				GUICtrlSetState($chkFileGetTimeRecurse, $GUI_UNCHECKED+$GUI_DISABLE)
				GUICtrlSetState($chkSetFilespecDate, $GUI_UNCHECKED+$GUI_DISABLE)
				GUICtrlSetState($txtSetFilespecDate, $GUI_DISABLE)
				GUICtrlSetState($chkSetFilespecDateRegEx, $GUI_DISABLE)
				GUICtrlSetState($radioSetUserdefDate, $GUI_CHECKED)
				GUICtrlSetData($txtSetUserdefDateDMY, @MDAY & "." & @MON & "." & @YEAR)
				GUICtrlSetData($txtSetUserdefDatehms, @HOUR & ":" & @MIN & ":" & @SEC)
				$refresh = 2
				
			Case $msg = $radioSetUserdefDate
				GUICtrlSetState($chkFileGetTimeRecurse, $GUI_UNCHECKED+$GUI_DISABLE)
				GUICtrlSetState($chkSetFilespecDate, $GUI_UNCHECKED+$GUI_DISABLE)
				GUICtrlSetState($txtSetFilespecDate, $GUI_DISABLE)
				GUICtrlSetState($chkSetFilespecDateRegEx, $GUI_DISABLE)
				$refresh = 2
				
			Case $msg = $radioSetNewestDate Or $msg = $radioSetOldestDate
				GUICtrlSetState($chkFileGetTimeRecurse, $GUI_ENABLE)
				GUICtrlSetState($chkSetFilespecDate, $GUI_ENABLE)
				GUICtrlSetState($txtSetFilespecDate, $GUI_ENABLE)
				GUICtrlSetState($chkSetFilespecDateRegEx, $GUI_ENABLE)
				$refresh = 3
				
			Case $msg = $chkSetFilespecDate Or $msg = $chkFileGetTimeRecurse Or $msg = $chkSetFilespecDateRegEx
				$refresh = 3
				
			Case $msg = $btnPreview Or $msg = $btnOK
				For $i = 1 To $tcpnl[0]
					GUICtrlSetData($lstPreviewItem[$i][0], $lstPreviewItem[$i][2] & "|" & _FmtDtTm($lstPreviewItem[$i][3]) & "|")
				Next
				$refresh = 0
				If GUICtrlRead($radioSetNewestDate) = $GUI_CHECKED Or GUICtrlRead($radioSetOldestDate) = $GUI_CHECKED Then $refresh = 3
				If GUICtrlRead($radioSetUserdefDate) = $GUI_CHECKED Then
					$refresh = 2
					If Not StringRegExp(GUICtrlRead($txtSetUserdefDateDMY) & " " & GUICtrlRead($txtSetUserdefDatehms), "[0-3]\d\.[0-1]\d\.\d\d\d\d [0-2]\d:[0-5]\d:[0-5]\d") Then
						$refresh = 0
						MsgBox(0, "Datum ungültig", "Das eingegebene Datum / Uhrzeit ist ungültig")
					EndIf
				EndIf
				
		EndSelect
		
		If $refresh > 0 Then
			
			For $i = 1 To $tcpnl[0]
				
				If $lstPreviewItem[$i][1] <> "" Then
					$strPreviewItem = $lstPreviewItem[$i][2] & "|" & _FmtDtTm($lstPreviewItem[$i][3]) & "|"
					
					Select
						
						Case $refresh = 1
							$lstPreviewItem[$i][8] = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC
							$strPreviewItem = $strPreviewItem & _FmtDtTm($lstPreviewItem[$i][8]) & "|"
							
						Case $refresh = 2
							$lstPreviewItem[$i][8] = StringRegExpReplace(GUICtrlRead($txtSetUserdefDateDMY), "(..)\.(..)\.(....)", "\3\2\1")
							$lstPreviewItem[$i][8] = $lstPreviewItem[$i][8] & StringRegExpReplace(GUICtrlRead($txtSetUserdefDatehms), "(..):(..):(..)", "\1\2\3")
							$strPreviewItem = $strPreviewItem & _FmtDtTm($lstPreviewItem[$i][8]) & "|"
							
						Case $refresh = 3
							$strYMDhmsMax = "00000000000000"
							$strYMDhmsMin = "99999999999999"
							$strYMDhmsMaxFilename = ""
							$strYMDhmsMinFilename = ""
							_BtnDisable()
							_DirGetMinMaxFileTime($lstPreviewItem[$i][1])
							_BtnEnable()
							$lstPreviewItem[$i][4] = $strYMDhmsMax
							$lstPreviewItem[$i][5] = $strYMDhmsMin
							$lstPreviewItem[$i][6] = $strYMDhmsMaxFilename
							$lstPreviewItem[$i][7] = $strYMDhmsMinFilename
							If GUICtrlRead($radioSetNewestDate) = $GUI_CHECKED Then
								If $strYMDhmsMax = "00000000000000" Then
									$strPreviewItem = $strPreviewItem & "---|---"
								Else
									$strPreviewItem = $strPreviewItem & _FmtDtTm($lstPreviewItem[$i][4]) & "|" & $lstPreviewItem[$i][6]
								EndIf
								$lstPreviewItem[$i][8] = $strYMDhmsMax
							Else
								If $strYMDhmsMin = "99999999999999" Then
									$strPreviewItem = $strPreviewItem & "---|---"
								Else
									$strPreviewItem = $strPreviewItem & _FmtDtTm($lstPreviewItem[$i][5]) & "|" & $lstPreviewItem[$i][7]
								EndIf
								$lstPreviewItem[$i][8] = $strYMDhmsMin
							EndIf
							
					EndSelect
					
					GUICtrlSetData($lstPreviewItem[$i][0], $strPreviewItem)
					
				EndIf
				
			Next
			$refresh = 0
			
			If $msg = $btnOK Then
				For $i = 1 To $tcpnl[0]
					If $lstPreviewItem[$i][1] <> "" Then
						If $lstPreviewItem[$i][8] = "00000000000000" Or $lstPreviewItem[$i][8] = "99999999999999" Then
							GUICtrlSetData($lstPreviewItem[$i][0], $lstPreviewItem[$i][2] & "|Unverändert|" & _FmtDtTm($lstPreviewItem[$i][3]))
						Else
							If FileSetTime($lstPreviewItem[$i][1], $lstPreviewItem[$i][8], 0, 0) Then
								GUICtrlSetData($lstPreviewItem[$i][0], $lstPreviewItem[$i][2] & "|OK|" & _FmtDtTm($lstPreviewItem[$i][8]))
							Else
								GUICtrlSetData($lstPreviewItem[$i][0], $lstPreviewItem[$i][2] & "|Fehler!|" & _FmtDtTm($lstPreviewItem[$i][8]))
							EndIf
						EndIf
					EndIf
				Next
				GUICtrlSetState($btnOK, $GUI_DISABLE)
				GUICtrlSetState($btnPreview, $GUI_DISABLE)
				GUICtrlSetData($btnCancel, "Schließen")
;~ 				GUIDelete($frmGUI)
;~ 				Exit
			EndIf
			
		EndIf
	
	WEnd

EndIf

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Func _DirGetMinMaxFileTime($dirname)
	
	Local $filename
	FileChangeDir($dirname)
	Local $shndSearch = FileFindFirstFile("*.*")
	If @error Then Return
	
	While 1
		$filename = FileFindNextFile($shndSearch)
		If @error Then ExitLoop
		
		If StringInStr(FileGetAttrib($filename), "D") And GUICtrlRead($chkFileGetTimeRecurse) = $GUI_CHECKED Then
			_DirGetMinMaxFileTime($filename)
			FileChangeDir("..")
		EndIf
		
		If Not StringInStr(FileGetAttrib($filename), "D") Then
			$strYMDhmsCur = FileGetTime($filename, 0, 1)
			If GUICtrlRead($chkSetFilespecDate) = $GUI_UNCHECKED _
			Or (GUICtrlRead($chkSetFilespecDate) = $GUI_CHECKED And GUICtrlRead($chkSetFilespecDateRegEx) = $GUI_UNCHECKED And $filename = GUICtrlRead($txtSetFilespecDate)) _
			Or (GUICtrlRead($chkSetFilespecDate) = $GUI_CHECKED And GUICtrlRead($chkSetFilespecDateRegEx) = $GUI_CHECKED And StringRegExp($filename, GUICtrlRead($txtSetFilespecDate)) = 1) Then
				If $strYMDhmsCur > $strYMDhmsMax Then
					$strYMDhmsMax = $strYMDhmsCur
					$strYMDhmsMaxFilename = $filename
				EndIf
				If $strYMDhmsCur < $strYMDhmsMin Then
					$strYMDhmsMin = $strYMDhmsCur
					$strYMDhmsMinFilename = $filename
				EndIf
			EndIf
		EndIf
		
	WEnd
	
	FileClose($shndSearch)
	Return
	
EndFunc

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Func _FmtDtTm($datetime)
	Return StringRegExpReplace($datetime, "(....)(..)(..)(..)(..)(..)", "\3.\2.\1 \4:\5:\6")
EndFunc

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Func _BtnDisable()
	GUICtrlSetState($btnCancel, $GUI_DISABLE)
	GUICtrlSetState($btnOK, $GUI_DISABLE)
	GUICtrlSetState($btnPreview, $GUI_DISABLE)
	GUICtrlSetData($lblStatus, "Bitte warten...")
EndFunc

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Func _BtnEnable()
	GUICtrlSetState($btnCancel, $GUI_ENABLE)
	GUICtrlSetState($btnOK, $GUI_ENABLE)
	GUICtrlSetState($btnPreview, $GUI_ENABLE)
	GUICtrlSetData($lblStatus, "")
EndFunc
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
jjk
Member
Member
Posts: 181
Joined: 2003-07-03, 10:41 UTC

Post by *jjk »

Thanks. I'll try them both.
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

No need. Van Dusen's script is way better, it has a GUI, and various options. The only drawback is, it was written for AutoIt3 and most of us here prefer AutoHotkey ;-) or say better, AutoHotkey loving guys are more active here, see the wiki: http://www.ghisler.ch/wiki/index.php/AutoHotkey
I switched to Linux, bye and thanks for all the fish!
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

I've uploaded a slightly modified version (language support added) of the AutoIT script "SetFolderDate":

SetFolderDate.zip (182KiB)


The ZIP-file contains
- the script (*.au3),
- a compiled version of the script (*.exe; no AutoIT installation needed to run the EXE) and
- an INI-file with localized strings (sections [ENG] (=default) and [DEU] already included).

Your favourite language isn't detected automatically yet. You need to edit the SetFolderDate.ini accordingly. Save your INI-file in the directory, where the SetFolderDate.exe (or SetFolderDate.au3) is stored.

Important note:
The string for key #26 ("No files selected!") in the language section xxx should be identical to key #51 in your wincmd_xxx.lng-file.
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

OT

Post by *XPEHOPE3KA »

2van Dusen
182KiB
Our guy! :razz:
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

The Man !

Post by *Clo »

2XPEHOPE3KA

:) Hello !

• YES ! Nice to see !


2van Dusen

:) Hello !

AHHHH !

:mrgreen: KR ¦ VG
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
jjk
Member
Member
Posts: 181
Joined: 2003-07-03, 10:41 UTC

Post by *jjk »

Very nice ! and very useful for me because I don't understand German language, I just guess the words from such a little piece of code as SetFolderDate.au3.

Can I ask an enhancement ? It would be nice to exclude (optionnally) descript.ion file from research. Because when I move a file, the descript.ion file's date is updated to today's date. But no file has been added to the directory, so I want to consider that the newest file is not automatically descript.ion.

BTW I've slightly modified SanskritFritz's AHK script :

Code: Select all

loop %sFolder%\*,,1
{
	bThereIsFile := True
	if (dTimestamp < A_LoopFileTimeModified and A_LoopFileName<>"descript.ion")
to add scanning subdirectories and exclude descript.ion file.

Other enhancement I'd find useful : to make such a script but just for descript.ion file date, not for directories : to adjust descript.ion's filedate to date of the newest file descripted inside descript.ion

TIA

Jean-Jacques
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

SetFolderDate_1.2

Post by *van Dusen »

I've uploaded a new version of the SetFolderDate script:

SetFolderDate_1.2.zip (190KiB)

What's new/changed?

Support for archives

Set timestamp of archives from newest/oldest file inside. SetFolderDate uses 7z.exe from a full 7zip-installation to get filelists from archives. All archive formats, which can be read from 7z.exe, are supported by SetFolderDate:
7z;arj;bz2;cab;chm;cpio;deb;gz;iso;lzh;nsis;rar;rpm;split;tar;z;zip
The list of examined archive formats should be found in key SupportedArchiveFormats (section Configuration) in the SetFolderDate.ini. The filename (full path) should be given in key ProgPath7z.

Archives are allways searched recursively (state of checkbox "scan recursively" is ignored for archives)

If 7z.exe is not found for any reason, only directories are supported.


Userdefined colours for preview list entries

You can define separate colours for directory and archive entries in the preview list:
Keys DirColorRGB for directory entries, key ArcColorRGB for archive entries, key NOPColorRGB for entries, which cannot be examined (e.g. empty directories)


Ignorelist

You can define a list of filenames, which should be excluded from examination (e.g. descript.ion). These filenames should be listed in section Ignorelist of the SetFolderDate.ini. Unfortunately file patterns / regular expressions are not supported for filenames in the ignorelist (full / expanded filenames are required).

In SetFolderDate dialogue a checkbox is added to enable / disable reading from the ignorelist.


Type of timestamp (modified/created/accessed)

You can choose the type of date/time of the selected directories and archives, which should be changed (new combobox in SetFolderDate dialogue). Furthermore, you can choose the type of date/time, which should be read from the files in a directory (new combobox). This allows to set the creation date of a directory/archive to the newest "modified" date (obtained from the files inside the directory), for instance.

The lists generated by 7z.exe contains only the "modified" dates of the archived files. Thus, the newest/oldest "created" or "last accessed" date can't be determined for files inside archives.


DOS-patterns in "certain file" string are tranformed to RegEx

When the "certain file" checkbox is checked and the "RegEx" checkbox is unchecked, then SetFolderDate tries to transform DOS patterns ("*" or "?" are found in the string in the "certain file" inputbox) to regular expressions. The checkbox "RegEx" will be checked automatically, if a transformation was made.
Post Reply