0

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT*\shell\FileDateTime] @="File DateTime Attribute (1 file at a time)"

[HKEY_CLASSES_ROOT*\shell\FileDateTime\command] @="powershell.exe $Filename=Get-ChildItem \\"\"%1\\"\"; $TEMP2=($(Get-Date).Year)+1; $TEMP=\\"\"January 1, {0} 12:00:00 AM\\"\" -f $TEMP2; $Filename.creationtime=$TEMP; $Filename.lastaccesstime=$TEMP; $Filename.lastwritetime=$TEMP"

=====================

I got this registry key that I made up. (see above) It's purpose was to change all three DateTime attributes so I could "mark them" prior to backing them up on an external storage. But since Windows and PowerShell security would block scripts from running, this seem to be the best solution without referring to a separate script file (*.ps1), and making it a built-in code. Anyone got any better ideas to do this- especially to handle multiple files at once? Just as a note: this registry hack does work! And does not require using CMD.exe!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.