damienvanrobaeys / About_my_device

About my device: A systray tool for that displays device information and run action like send logs or sync device
34 stars 6 forks source link

add new feature to Storage Tab #9

Open christophFeiker opened 3 years ago

christophFeiker commented 3 years ago

I think it would be nice to add a cleanup action to Storage Tab. following code lines can be used to delete all temporary cached files with Disk Clenaup:

Get-ChildItem -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches' | New-ItemProperty -Name StateFlags0001 -Value 2 -PropertyType DWORD Start-Process -FilePath CleanMgr.exe -ArgumentList '/sagerun:1' -WindowStyle Hidden -Wait Get-ChildItem -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches' | remove-ItemProperty -Name StateFlags0001