Either way I use these registry settings and Windows on:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned]...
I know you asked for a bat file but I use this .reg file from the context menu. It has (2) choices to empty the trash:
1) With Confirmation
2) Without Confirmation
Below is the code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\empty]...