r/Batch

▲ 3 r/Batch

A batch script that fixes mouse issues

Run this as admin:
taskkill /f /im explorer.exe

timeout /t 1 /nobreak

start explorer.exe

net stop hidserv

net start hidserv

gpupdate

sfc /scannow

dism /online /cleanup-image /restorehealth

powershell -Command "Get-PnpDevice -Class Mouse | Remove-PnpDevice -Confirm:$false"

shutdown /r /t 1

reddit.com
u/Successful_Test1825 — 1 day ago
▲ 3 r/Batch

I'm converting a bunch of files from .webp to .png using a .bat file and ffmpeg. This process messes up the order of the files, since they no longer have their original Date Created metadata, and lots have irregular names.

I want to rename the files to include their creation dates at the start, so that if they're sorted by name, they'll still be in order.

The only method I've been able to find so far (using %%~tF in a for loop) only gives me the time down to the minute, which is no good, since lots of the files were created in the same minute.

What's a good way to get the precise time a file was created? I know that metadata must be stored somewhere, since when you sort by 'Date Created' it does it correctly, even if things were created within seconds of each other. I'm just not sure how to get that information using .bat.

reddit.com
u/Glen_Garrett_Gayhart — 10 days ago