New
#41
Cleaning temp files/folders is what CCleaner does once you set it up correctly.
It's also what Disk Cleanup from File Explorer does.
Thank you Paul, very useful collection...
If you are interested, see whether the following code works across different systems.
It does not useCode:Fsutil Dirty Query %SystemDrive%>Nul && Goto:[Run_as_administrator] Echo CreateObject^("Shell.Application"^). ^ ShellExecute "%~0","+","","RunAs",1 >"%temp%\+.vbs"&&"%temp%\+.vbs"&Exit :[Run_as_administrator]Net session
, which I believe is the cause of the multiple CMD windows.
Matthew, tried that in a test.bat:
It still gets a single blip which I expect when re-launching the Command Prompt as Administrator.Code:(Fsutil Dirty Query %SystemDrive% >nul 2>&1)||(PowerShell start """%~f0""" -verb RunAs & Exit /B) Echo. Echo Running as Administrator pause
Here is a reco0rding of it being run. UAC Disabled, Defender SmartScreen Filte disabled.
test.bat.mp4.zip
@Paul Black I've seen in my readings here numerous mentions of your batch file writing skills and the fact that you contribute/share these with the members. Think the last time was in a tutorial on adding back missing power settings. In any event, decided this morning to see if I could find some listing of these batch files. Clicked on your name which took me to your profile page and lo and behold, there was the listing. I'm sure for the next few days I'll be spending much of my morning coffee time reviewing your scripts. Thank you!
I use your "Clear Event Viewer" every morning (part of that whole OCD thing I suspect) just prior to making my MR differential backup and will try out the revised/enhanced version today.
@Paul Black doing a great job Paul...
I've tested the "Files_To_Folders_Using_Filenames.bat" and noticed that it doesn't prevent that the batch itself get's moved if you change the batch's filename.
Maybe if you change:
if not "%%~ni" == "Files_To_Folders"
To:
if not "%%~ni" == "%~n0"
It'll work even if the user changes the batch's filename...