Move Files/Folders To Timestamped Directory

I currently use Opera Portable as a web browser, but don't care for the ever expanding caches. I would love to have a button that would move files from the various cache folders, or others that are really unneeded, and move them into a timestamped directory on another drive, in case I do actually need them.

Thanks.

Shawn

The default toolbars have a Move Into Dated Folder command:

That creates the folder in the current directory, and moves the selected items into it.

You could adapt it to create the folder in another place if you wanted.

Thanks.

I edited a code that I found elsewhere and came up with:

Rename PATTERN * TO "C:\Downloads\{date|yyyy.MM.dd} - {time|HH.mm.ss}\*" FILEINFO

It does what I want, only I am looking to take it one step further. I would like a button that would do the same thing, only without the directories being actually selected. Something when pushed would automatically move a bunch of folders from different directories to a single timestamped folder in another location.

Example.
Move all files/folders from:

\profile\data\Cache\Cache_Data
\profile\data\Code Cache
\profile\data\GPUCache
\profile\data\BrowserMetrics-spare.pma
\profile\data\adblocker_rules.json

To:

2023.08.18 - 17.16.55\Cache_Data
2023.08.18 - 17.16.55\Code Cache
2023.08.18 - 17.16.55\GPUCache
2023.08.18 - 17.16.55\BrowserMetrics-spare.pma
2023.08.18 - 17.16.55\adblocker_rules.json

Both the Copy and Rename commands let you specify the files you want them to copy/move/rename, so you can do that.

Documentation is here:

https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Internal_Commands.htm

You'll want to lock in the date-time at the start so that each command doesn't use a different destination folder (if the previous command took more than a second). You can do it like this:

@set FolderName={date|yyyy.MM.dd} - {time|HH.mm.ss}
Copy MOVE FILE=".\profile\data\Cache\Cache_Data" TO="C:\Downloads" CREATEFOLDER="{$FolderName}"
Copy MOVE FILE=".\profile\data\Code Cache" TO="C:\Downloads" CREATEFOLDER="{$FolderName}"
... etc. ...

(This is assuming you meant the profile directory should be below the current directory. If not, change the paths as appropriate)

Thanks that worked great. Also, thanks for all the other help that you and everyone else have given me. You guys really know the ins and outs of this program. I have got the program so personalized, it's almost painful when I HAVE to use Windows Explorer.

Shawn

That's definitely a good coding style - but is it really necessary? Aren't these variables evaluated once at the beginning and then kept throughout the execution?

You're right, it doesn't seem to be needed in this case (from a quick test), at least today.

Have seen some situations where something similar was needed, so it's easier to always use the pattern, and tidies up the button as well.