Using classic Outlook for Windows in business environments
You can create a batch file that uses a wildcard for the username to delete files in a specific folder across all users. Here's an example of how you can do it:
batch
@echo off
set folderPath=C:\Users%username%\AppData\Local\Packages\microsoft.windowscommunicationsapps_8wekyb3d8bbwe\LocalState\Migration\*
del /Q "%folderPath%"
echo Files in %folderPath% have been deleted.
pause--------------------------------------------------------------
This script does the following:
-
@echo offprevents commands from being displayed in the command prompt. -
set folderPath=C:\Users\%username%\specific_folder\*sets the folder path, where%username%is a wildcard that automatically gets replaced with the currently logged-in user's username. -
del /Q "%folderPath%"deletes all files in the specified folder quietly (/Q). -
echo Files in %folderPath% have been deleted.prints a message indicating that the files have been deleted. -
pausekeeps the command prompt window open so you can see the message.
You could then save this file in the startup shell, just press the Windows key + R then type Shell:startup then OK
This should take you to the folder where you could save the batch file which will run each time a user logs on.
Hope this helps :)