PowerBI – Daily Clean Old Files of PowerUpdate Folders

Last updated on August 4th, 2019 at 05:16 am

Power Update utility is creating bunch of files for every running task in two principal paths:
1. C:\Users\%username%\AppData\Local\Microsoft\Power BI Desktop\LucaIndex
2. C:\Users\%username%\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces
3. C:\Users\%username%\AppData\Local\Microsoft\Power BI Desktop\TempSaves

 

If you want to avoid your disk to get filled fast, you need to create two task schedules to delete automatically old files every day:

1. Create a batch script and name it ‘DailyClean_LucialIndex.bat’

@echo off
cd C:\
forfiles -p "C:\Users\%username%\AppData\Local\Microsoft\Power BI Desktop\LuciaIndex" -d -1 -c "cmd /c IF @isdir == TRUE rd /S /Q @path"

 

2. Create another batch script and name it ‘DailyClean_AnalysisServicesWorkspaces.bat’

@echo off
cd C:\
forfiles -p "C:\Users\%username%\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces" -d -1 -c "cmd /c IF @isdir == TRUE rd /S /Q @path"

 

3. Create another batch script and name it ‘DailyClean_TempSaves.bat’

@echo off
cd C:\
forfiles -p "C:\Users\%username%\AppData\Local\Microsoft\Power BI Desktop\TempSaves" -m *.pbix -d -1 -c "cmd /c del /S /Q @path"

 

4. Open Task scheduler -> Create 3 tasks that each one will run (Action) each of .bat files everyday in some silent hour.

Done 🙂