The previous reaction doesn't correspond to this problem. The link works for me. Use this one.
Are you asking me?
Moderators: Hacker, petermad, Stefan2, white
The previous reaction doesn't correspond to this problem. The link works for me. Use this one.
Are you asking me?
Hi friend. Thanks for this code. It sounds like a function I really would love to use. But when I enter this button it opens a CMD window and just fails.Horst.Epp wrote: 2023-06-07, 20:15 UTC Hier my TC button which always goes to the newest entry,
which I find more usefull than the first file.Code: Select all
TOTALCMD#BAR#DATA cmd.exe /k "for /f "usebackq delims=" %%f in (`dir /b /a-d /o-d`) do start "" "%%COMMANDER_EXE%%" /O /S /L="%%~ff\:" & exit" C:\Tools\Wincmd\Icons\Down-Blue.ico Newest File 1 -1
You can use this button to go to the NEWEST file:It sounds like a function I really would love to use
Code: Select all
TOTALCMD#BAR#DATA
cm_SrcByName 8,cm_SrcByDateTime 2,cm_GoToFirstFile,cm_SrcByName 9
wcmicons.dll,7
Go to newest file
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".
Of course, there is a cmd window for a short time.linuxy wrote: 2023-06-19, 18:09 UTCHi friend. Thanks for this code. It sounds like a function I really would love to use. But when I enter this button it opens a CMD window and just fails.Horst.Epp wrote: 2023-06-07, 20:15 UTC Hier my TC button which always goes to the newest entry,
which I find more usefull than the first file.
Can you tell me why you think this may be happening?
it says "file not found" in my CMD window after running this button.
Some directories it does work correctly but sometimes certain directories it just fails. Local C drive, no network drives. Thank you for help.
Moderator message from: white » 2023-06-19, 21:00 UTC
What you mean is that your button works since before TC 10.50 - My solution works with Windows 7 too, but NOT with TC prior to 10.50b7.2petermad
My cmd button to find the newest file works here since Windows 7.
Your solution has the disadvantage that the current sort order is destroyed
my version works with any sorting and doesn't change it in any way.
history.txt wrote:25.05.22 Added: New parameters 8 and 9 for all internal commands cm_srcby*, e.g. cm_srcbyname 8 saves the current sort order internally, cm_srcbyname 9 restores it (32/64)
Sorry, I ignored this new functionspetermad wrote: 2023-06-19, 20:58 UTC My solution does preserve the current sort order, because I use cm_SrcByName 8 at the start and cm_SrcByName 9 at the end.
history.txt wrote:25.05.22 Added: New parameters 8 and 9 for all internal commands cm_srcby*, e.g. cm_srcbyname 8 saves the current sort order internally, cm_srcbyname 9 restores it (32/64)
Yes, the cmd window is expected. I was just saying, it stays on screen - and says "file not found". That's my issue.Horst.Epp wrote: 2023-06-19, 20:09 UTCOf course, there is a cmd window for a short time.linuxy wrote: 2023-06-19, 18:09 UTCHi friend. Thanks for this code. It sounds like a function I really would love to use. But when I enter this button it opens a CMD window and just fails.Horst.Epp wrote: 2023-06-07, 20:15 UTC Hier my TC button which always goes to the newest entry,
which I find more usefull than the first file.
Can you tell me why you think this may be happening?
it says "file not found" in my CMD window after running this button.
Some directories it does work correctly but sometimes certain directories it just fails. Local C drive, no network drives. Thank you for help.
It works here since Windows 7 for local drives without any problem.
Maybe you did make an error while copying the button code ?
I will try again, but that button also did not work. I'm happy to make a brief screencast showing I'm doing it correctHorst.Epp wrote: 2023-06-22, 11:35 UTC 2linuxy
My button works here in full, brief and thumbnail view.
If you can't get it to work, try petermad's button from above.
This also works fine and is pure TC.
BTW, Because my solution only uses TC functions, it also works inside Archives, on FTP sites, and in Virtual folders.Horst.Epp wrote: 2023-06-19, 22:16 UTCSorry, I ignored this new functionspetermad wrote: 2023-06-19, 20:58 UTC My solution does preserve the current sort order, because I use cm_SrcByName 8 at the start and cm_SrcByName 9 at the end.
history.txt wrote:25.05.22 Added: New parameters 8 and 9 for all internal commands cm_srcby*, e.g. cm_srcbyname 8 saves the current sort order internally, cm_srcbyname 9 restores it (32/64)![]()
No it means the last Modified files (it is the modified date TC shows in Full View - as Do Explorer)Just to clarify, when you say "the newest file", does that mean like, the file that's been 'touched' most recently, i.e. the last file/folder to be moved into this location?
This button will go to the newest folder:Because this button does not select the most recently moved file/folder, it must be looking at some other "date" value. Which date is it?
Code: Select all
TOTALCMD#BAR#DATA
%COMSPEC%
/k "for /f "usebackq delims=" %%f in (`dir /b /ad /o-d`) do start "" "%%COMMANDER_EXE%%" /O /S /P /L="%P%%f" & exit"
wcmicons.dll,7
Go to newest folder
1
-1
Code: Select all
[em_hide_all]
cmd=cd |*
[em_gotonewestdir]
cmd=cm_SaveSelection,cm_SwitchDirSort 2,cm_SrcUserSpec 8,cm_SrcByName 8,em_hide_all,cm_SrcByDateTime 2,cm_GoToFirstEntry,cm_SrcUserSpec 9,cm_SrcByName 9,cm_RestoreSelection
menu=Go to newest folder
This button should go to the newest file OR folder:Only files are possible?
Can you please tell me what code I can change for this button to "go to newest file OR folder", whichever is newest? Thank you.
Code: Select all
TOTALCMD#BAR#DATA
%COMSPEC%
/k "for /f "usebackq delims=" %%f in (`dir /b /o-d-g`) do start "" "%%COMMANDER_EXE%%" /O /S /P /L="%P%%f" & exit"
wcmicons.dll,7
Go to newest file OR folder
1
-1
You are a genius!!!!petermad wrote: 2023-06-22, 22:04 UTCNo it means the last Modified files (it is the modified date TC shows in Full View - as Do Explorer)Just to clarify, when you say "the newest file", does that mean like, the file that's been 'touched' most recently, i.e. the last file/folder to be moved into this location?
This button will go to the newest folder:Because this button does not select the most recently moved file/folder, it must be looking at some other "date" value. Which date is it?This will NOT work inside Archives, on FTP sites, and in Virtual folders.Code: Select all
TOTALCMD#BAR#DATA %COMSPEC% /k "for /f "usebackq delims=" %%f in (`dir /b /ad /o-d`) do start "" "%%COMMANDER_EXE%%" /O /S /P /L="%P%%f" & exit" wcmicons.dll,7 Go to newest folder 1 -1
Or you can put this code in your usercmd.ini file:An then make a button with em_gotonewestdir in the Command field.Code: Select all
[em_hide_all] cmd=cd |* [em_gotonewestdir] cmd=cm_SaveSelection,cm_SwitchDirSort 2,cm_SrcUserSpec 8,cm_SrcByName 8,em_hide_all,cm_SrcByDateTime 2,cm_GoToFirstEntry,cm_SrcUserSpec 9,cm_SrcByName 9,cm_RestoreSelection menu=Go to newest folder
This will ALSO work inside Archives, on FTP sites, and in Virtual folders.
If you look at the em_gotonewestdir command you will see that it uses em_hide_all - so at least the em_hide_all command has to be in the usercomd.ini file.What is the advantage of adding that to the usercmd.ini file, instead of simply making a button and that's it?
Code: Select all
TOTALCMD#BAR#DATA
cm_SaveSelection,cm_SwitchDirSort 2,cm_SrcUserSpec 8,cm_SrcByName 8,em_hide_all,cm_SrcByDateTime 2,cm_GoToFirstEntry,cm_SrcUserSpec 9,cm_SrcByName 9,cm_RestoreSelection
wcmicons.dll,7
Go to newest folder
Code: Select all
TOTALCMD#BAR#DATA
em_gotonewestdir
wcmicons.dll,7
Go to newest folder