Select all files with same date?
Moderators: Hacker, petermad, Stefan2, white
Select all files with same date?
Is it possible to select all files with the same date (not time)?
Re: Select all files with same date?
The easiest way would be to sort files by date, mark the first file of the given date and then Shift-click on the last file of the given date
Last edited by petermad on 2019-02-18, 08:32 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Select all files with same date?
Search for files *.* with Alt+F7 and option "advanced" "date between"; fill in the same date.
Re: Select all files with same date?
And then: "Feed to listbox" -> Mark all filesSearch for files *.* with Alt+F7 and option "advanced" "date between"; fill in the same date.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
VBScript: Select all files with same date
You can utilize a external script, TC will support you with parameters to send arguments to such scripts.f0ff886f wrote: 2019-02-17, 13:13 UTC Is it possible to select all files with the same date (not time)?
Here is a VBScript to do what you want (it is a bit slow, better we would rewrite this in AutoHotkey)
EDIT: sorry, I forgot, this may work for German date (18.02.2019) only.
If from interests, I have to adjust the code to work with 02/18/2019 too

But I just take the first ten signs, so it may work for English language setting too just out of the box.
VBScript for TotalCommander
Select all files with same DATE as current selected file.
Save the Code block as "SelectSameDate.vbs" in TC folder and create a button.
Next select one file, then execute the button
You may want to use menu "SHOW > Only Selected Files"
( use "Show > All Files" to see all files again )
TC -Button:
Code: Select all
'English/Deutsch/UserCmd.ini : Entry / Eintrag
Command/Kommando/cmd: "%Commander_Path%\SelectSameDate.vbs"
Parameters/Parameter/param: %P%N
Start path/Startpfad/path:
Icon file/Icon/button: C:\windows\System32\WScript.exe
Tooltip/Tooltip/menu : Select files with same DATE as current selected file
SelectSameDate.vbs
Code: Select all
'// VBScript for TotalCommander, Stefan, v00.1, 2019-Feb-18
'// Select all files with same DATE as current selected file.
'
' Found at https://ghisler.ch/board/viewtopic.php?p=351709#p351709
'
'// Save THE CODE as "SelectSameDate.vbs" in TC folder and create a button.
'// Next select one file, then execute the button
'// You may want to use menu "SHOW > Only Selected Files"
'// ( use "Show > All Files" to see all files again )
'
'
'// TC -Button:
'English/Deutsch/UserCmd.ini : Entry / Eintrag
'Command/Kommando/cmd: "%Commander_Path%\SelectSameDate.vbs"
'Parameters/Parameter/param: %P%N
'Start path/Startpfad/path:
'Icon file/Icon/button: C:\windows\System32\WScript.exe
'Tooltip/Tooltip/menu : Select files with same DATE as current selected file
'//--------------------------------------------------------
'//--------------------------------------------------------
'//-------------------------------------------------------- // THE CODE 'SelectSameDate.vbs
'
Set FSO = CreateObject("Scripting.FileSystemObject")
strCurrentFile = Wscript.arguments.Item(0) '//%P%N
'
If(strCurrentFile ="") Then
MsgBox "No Selection, Script ends here."
WScript.Quit
End If
'
Set oItem = FSO.GetFile(strCurrentFile)
sName = FSO.GetFileName(oItem)
sBase = FSO.GetBaseName(oItem)
sExte = FSO.GetExtensionName(oItem)
sPath = oItem.ParentFolder
sCreated = oItem.DateCreated
sAccessed = oItem.DateLastAccessed
sModified = oItem.DateLastModified
sDATEonly = left(sModified,10)
Set oFolder = FSO.GetFolder(sPath)
Set colFiles = oFolder.Files
For Each oFile in colFiles
If(left(oFile.DateLastModified,10) = sDATEonly) Then
sOUT = sOUT & oFile.Name & vbCRLF
End If
Next
'
'MsgBox sOUT
SetClipboard sOUT
'
' cm_LoadSelectionFromClip=2033;Read file selection from clipboard
SendMessage "Total Commander",1075,2033,0
'
'
'//--------------------------------------------------------
'//-------------------------------------------------------- HELPER function
'//--------------------------------------------------------
'VBScript SendMessage
'http://demon.tw/copy-paste/vbs-sendmessage.html
'BY Coo_boi
Function SendMessage(lpWinTitle,wMsg,wParam,lParam)
Dim WordApp,ShApp,colTask,oTask
Set WordApp=CreateObject("Word.Application")
Set colTask=wordapp.Tasks
SendMessage=False
For Each oTask In colTask
If oTask.Visible And InStr(oTask.Name,lpWinTitle) Then
oTask.SendWindowMessage wMsg,wParam,lParam
SendMessage=True
Exit For
End If
Next
WordApp.Quit
Set WordApp=Nothing
End Function
'//--------------------------------------------------------
Function SetClipboard(stringToSet)
On Error Resume Next
Dim objIE : Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
Do While objIE.busy : WScript.Sleep 100 : Loop
objIE.Navigate("about:blank")
objIE.document.parentwindow.clipboardData.SetData "text", stringToSet
objIE.Quit
End Function
'//--------------------------------------------------------
'//END
Re: Select all files with same date?
Stefan2,
Great idea! I have created an AHK version:
Or a shorter, less readable version:
HTH
Roman
Great idea! I have created an AHK version:
Code: Select all
FileGetTime, Date, %1%
FormatTime, Date, %Date%, yyyyMMdd
Loop, Files, *.*
{
FormatTime, DateChecked, %A_LoopFileTimeModified%, yyyyMMdd
If (DateChecked = Date)
SameDateFileList .= A_LoopFileName . "`n"
}
If (SameDateFileList)
{
ClipboardBak = %ClipboardAll%
Clipboard := Substr(SameDateFileList, 1, StrLen(SameDateFileList) - 1)
PostMessage, 1075, 2033, , , ahk_class TTOTAL_CMD
Sleep, 1000
Clipboard = %ClipboardBak%
}
Code: Select all
FileGetTime, Date, %1%
FormatTime, Date, %Date%, yyyyMMdd
Loop, Files, *.*
SameDateFileList .= Substr(A_LoopFileTimeModified, 1, 8) = Date ? A_LoopFileName . "`n" : ""
If (SameDateFileList)
{
ClipboardBak = %ClipboardAll%
Clipboard := Substr(SameDateFileList, 1, StrLen(SameDateFileList) - 1)
PostMessage, 1075, 2033, , , ahk_class TTOTAL_CMD
Sleep, 1000
Clipboard = %ClipboardBak%
}
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Re: Select all files with same date?
Thank you very much, Roman.
Your script works fine with German date dd.mm.yyyy
Bonus points for working on just today date, if you forget to add the parameter on the button
Your script works fine with German date dd.mm.yyyy
Bonus points for working on just today date, if you forget to add the parameter on the button

Re: Select all files with same date?
Stefan2,
Yes, that's a side effect of leaving out the parameter check.
Roman
Yes, that's a side effect of leaving out the parameter check.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Re: Select all files with same date?
Hi,
I am also very interested in the AHK script.
Unfortunately, I rarely (twice) managed to color files accordingly.
The next time I tried it, I couldn't color the files anymore.
Does anyone have any idea why?
- Autohotkey: Latest Version
- cm_srclong
- no View Mode and Auto Switch Mode
- no other colouring
A test with a TC_clean.ini - 9.21a (x64) - 64 bit was also negative.
I am at a loss
Regards
Karl
EDIT: "Start path" in button: %COMMANDER_PATH%\Tools\AutoHotkey\ REMOVED!
I am also very interested in the AHK script.
Unfortunately, I rarely (twice) managed to color files accordingly.
The next time I tried it, I couldn't color the files anymore.
Does anyone have any idea why?
Code: Select all
FileGetTime, Date, %1%
FormatTime, Date, %Date%, dd.mm.yyyy
Loop, Files, *.*
SameDateFileList .= Substr(A_LoopFileTimeModified, 1, 8) = Date ? A_LoopFileName . "`n" : ""
If (SameDateFileList)
{
ClipboardBak = %ClipboardAll%
Clipboard := Substr(SameDateFileList, 1, StrLen(SameDateFileList) - 1)
PostMessage, 1075, 2033, , , ahk_class TTOTAL_CMD
Sleep, 1000
Clipboard = %ClipboardBak%
}
Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Tools\AutoHotkey\Dateien-mit-gleichem-DATUM-markieren.ahk
%P%N
%COMMANDER_PATH%\Tools\AutoHotkey\AutoHotkey.exe,1
Dateien mit gleichem DATUM markieren (Cursor auf einer Datei positionieren)
-1
Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Tools\AutoHotkey\Dateien-mit-gleichem-DATUM-markieren.ahk
%COMMANDER_PATH%\Tools\AutoHotkey\AutoHotkey.exe,1
Dateien mit heutigem DATUM markieren
-1
- cm_srclong
- no View Mode and Auto Switch Mode
- no other colouring
A test with a TC_clean.ini - 9.21a (x64) - 64 bit was also negative.
I am at a loss

Regards
Karl
EDIT: "Start path" in button: %COMMANDER_PATH%\Tools\AutoHotkey\ REMOVED!
Last edited by tuska on 2019-02-20, 12:51 UTC, edited 1 time in total.
Re: Select all files with same date?
Hi Karl,
What did you do in between, in Step 2?
1.) You execute the script, files are selected.
2.) you did <<<<< ? .... no file is selected anymore ?
3.) "The next time I tried it, I couldn't color the files anymore."
I had modified Romans' script
and tested it in my Temp-folder, and it works any time.
I have now removed that change, and the script works any time , even now without refreshing the list view.
- select a file
- execute the script
- files are highlighted
- click elsewhere
- execute the script
- files are highlighted
- .....
don't know what happens
tuska wrote: 2019-02-20, 10:48 UTC ...
Unfortunately, I rarely (twice) managed to color files accordingly.
>> ? <<
The next time I tried it, I couldn't color the files anymore.
...
What did you do in between, in Step 2?
1.) You execute the script, files are selected.
2.) you did <<<<< ? .... no file is selected anymore ?
3.) "The next time I tried it, I couldn't color the files anymore."
I had modified Romans' script
Code: Select all
PostMessage, 1075, 2033, , , ahk_class TTOTAL_CMD
;Menu "SHOW > Only Selected Files" > cm_ShowOnlySelected=2023;Hide files which aren't selected
PostMessage, 1075, 2023, , , ahk_class TTOTAL_CMD
Sleep, 1000
Clipboard = %ClipboardBak%
and tested it in my Temp-folder, and it works any time.
I have now removed that change, and the script works any time , even now without refreshing the list view.
- select a file
- execute the script
- files are highlighted
- click elsewhere
- execute the script
- files are highlighted
- .....
don't know what happens

Re: Select all files with same date?
Hi Stefan,Stefan2 wrote: 2019-02-20, 11:38 UTC Hi Karl,What did you do in between, in Step 2?tuska wrote: 2019-02-20, 10:48 UTC ...
Unfortunately, I rarely (twice) managed to color files accordingly.
>> ? <<
The next time I tried it, I couldn't color the files anymore.
...
1.) You execute the script, files are selected.
2.) you did <<<<< ? .... no file is selected anymore ?
3.) "The next time I tried it, I couldn't color the files anymore."
I did "Unselect All Ctrl Num -" and tried to color other files, but there was no more coloring.
During about 20 attempts, files were colored twice. Currently there is no more coloring.
I don't understand that.

Could you maybe use "my" script to test, please?
(I mean the Hacker's script that I'm using and announced above).
Re: Select all files with same date?
Hi Karl,
you have modified Romans' script yourself
means "Your script works fine on PCs with German date dd.mm.yyyy"
and don't mean to modify the script to work on German date format.
Just leave it as Roman posted it. (I don't know right now what that really would change, but... . Probably because of the Substr(xx, 1, 8 ) command)
HTH?
you have modified Romans' script yourself

My statement "Your script works fine with German date dd.mm.yyyy"tuska wrote: 2019-02-20, 10:48 UTCCode: Select all
FileGetTime, Date, %1% FormatTime, Date, %Date%, dd.mm.yyyy Loop, Files, *.* }
means "Your script works fine on PCs with German date dd.mm.yyyy"
and don't mean to modify the script to work on German date format.
Just leave it as Roman posted it. (I don't know right now what that really would change, but... . Probably because of the Substr(xx, 1, 8 ) command)
HTH?

Re: Select all files with same date?
Hi Stefan,
Yes, that was it!

Now everything works as desired ("Start path:" in button has to be left blank(!)).
Thank you so much for looking into that.
Regards,
Karl
Re: Select all files with same date?
Thank you all for the awesome scripts! I will use the AHK version, this is really amazing support. Many many thanks!
Re: Select all files with same date?
I have another request:
With this script (modified by Stefan2), after calling and receiving the filtered files from today, is it possible to
remove the marker? In this case, the red marking disturbs me and the only thing that will be shown anyway is the
files from today.
I tried the following command:
but without success.
With this script (modified by Stefan2), after calling and receiving the filtered files from today, is it possible to
remove the marker? In this case, the red marking disturbs me and the only thing that will be shown anyway is the
files from today.
Code: Select all
FileGetTime, Date, %1%
FormatTime, Date, %Date%, yyyyMMdd
Loop, Files, *.*
SameDateFileList .= Substr(A_LoopFileTimeModified, 1, 8) = Date ? A_LoopFileName . "`n" : ""
If (SameDateFileList)
{
ClipboardBak = %ClipboardAll%
Clipboard := Substr(SameDateFileList, 1, StrLen(SameDateFileList) - 1)
PostMessage, 1075, 2033, , , ahk_class TTOTAL_CMD
;Menu "SHOW > Only Selected Files" > cm_ShowOnlySelected=2023;Hide files which aren't selected
PostMessage, 1075, 2023, , , ahk_class TTOTAL_CMD
Sleep, 1000
Clipboard = %ClipboardBak%
}
Code: Select all
em_Dateien-mit-heutigem-DATUM-markieren_und-nur-diese-anzeigen,cm_ExchangeSelBoth