Is it possible to run an .exe after performing a context menu action?

Example: when creating a folder using a context menu item like:

@runonce:@set dirname={dlgstringS|Enter name of folder to move selection into|{file$|noext}}
Copy MOVE HERE FILE="{file$}" CREATEFOLDER="{$dirname}"

As a 2nd step I would select the folder and click on a toolbar button that does the following:

"D:\Directory Opus\SetFolDate\SetFolDateFM.exe" {ss} {Os}

This tool updates the folder modified date to the newest or oldest file date in that folder.

I very often use it.

After the folder has been created, the .exe shows up alright, but it does not work as the folder is not selected.

Q: how to have the newly created folder selected, so the folder date can be set?

AFAIK there is no Opus script doing the similar thing.


Just add that line tot the end of the existing command, maybe changing the arguments as appropriate so it's run on the correct path.

There's an Opus script which will show you the same information in an alternative date column, FWIW.

I already tried that, but the problem is that the newly created folder, after the copy move... is not selected.
Normally that would not be necessary, of course.
However, in this case the .exe then runs on 'nothing', whereas it should run on a selected folder.

Do not know whether it is possible to select the newly created folder. Probably not.

Tried by adding Select "{$dirname}" but that did not work.
Removed the parameters after the exe - did not work

As said, this tool changes the folder date using the newest or oldest file in date.
Actually it can do this recursively on a folder with many subfolders.

It shouldn't need to be selected. The command already knows the path and name and can feed them to the other program.

What are the arguments to SetFolDateFM.exe that it expects?

Being just a wild guess on my part, I added "{$dirname}" as an additional argument to the .exe and that seems to work

@runonce:@set dirname={dlgstringS|Enter name of folder to move selection into|{file$|noext}}
Copy MOVE HERE FILE="{file$}" CREATEFOLDER="{$dirname}" 
"D:\Directory Opus\SetFolDate\SetFolDateFM.exe" "{$dirname}" {ss} {Os}

I am sure it must be happening to others as well: for whatever vague reason one may occasionally end up with many folders having the same date stamp. Setting the folderdates to newest file in folder is handy then. That is the way I see it.

Folder timestamps are fragile and will change when a file in the folder is added, removed or (if I remember correctly) renamed.

(That’s something Windows/NTFS does, not anything we are doing.)

It’s best not to rely on them at all. Unless you know the folders will never be touched again, those timestamps will keep changing and need fixing.

You are right, Leo, I know. Indeed, usually the folders I am talking about are often somewhat older and usually not subject anymore to changes. Then again, it could be that a later file is added (still old), in which case the folder date is updated with this setfoldate thing.

FWIW: a portable tool (that can be added to the context menu) that does a similar thing is "FolderTimeUpdate" (NirSoft)

Anyway, thanks again, matter solved.

There's always this as an alternative: