Separate folder for ".bak" files

Been pondering a workaround for awhile and think there is a good way to do this except I don’t know how to do the last step (if possible).

The idea is to use the hidden file attribute in Windows to control visibility to .bak files. If the .bak files are set hidden then you will only see them when Windows Explorer is showing hidden items like this:
Hidden bak files.gif
While you can manually set a file hidden in the file’s Properties, you can do a whole disk’s worth using the command line prompt. But the limitation/problem with this is changing the attribute only works for the existing files, so newly created .bak files will not have the hidden attribute set. So they will start coming back. To get around this I put the command in a batch file that should be run with Admin privs.

:: Sets all the Cubase .bak files so they have the Hidden attribute set
:: Change the command from "+" to "-" to clear the Hidden attribute
:: Works on D: disk, change location to where your Cubase Projects are

@ECHO OFF

attrib +h /s D:*.bak

:: PAUSE

You can just execute the “attrib” command at the command line prompt, but the advantage of having it in a file is that you can use Task Scheduler to execute it (just copy the code into a text file with the .bat extension). For first time use, run the file (or command) to hide all existing .bak files. Now the only .bak files you see will be new ones. Using Task Scheduler create a task that runs the batch file at startup. Now you will only see .bak files created after starting the PC - so, not that many, but still some.

To get all the .bak files to always be set hidden even when they are brand new requires changing the Trigger used for the batch file execution in Task Scheduler. This is what I don’t know how to do, but I’m under the impression that there are triggers available that can detect changes to a folder that might be a mechanism to run the batch file as needed. If so the script should be changed so that instead of changing a whole disk it only changes files in that specific folder.