Way to auto clean-up after updates/downloads?

Hi,

I'm using VS2017 Community on Win10 1803.

I'd been putting off updating while fiddling around with another problem (don't add more variables to the issue! :-) ), but finally resolved that, so I downloaded all the updates yesterday. Next thing I know I'm running into unspecified problems, but eventually I realise it's because my Temp folder (which I have on a RAMdisk, for speed) had filled up - 4Gb of stuff hanging around! I suspect a good deal of it from the updates. Had to manually clean-up, as several files were non-deletable (and typical Windows wouldn't just do the others - all or nothing).

Do some updating of my Android emulator, next thing I know the Temp folder is full again! Another 4Gb of files hanging around.

Is there something I can click on or some command I can run which will clean up the temp files after these updates? It's a pain having to do it manually. Oh, BTW, when I tried running the Windows disk clean-up, it didn't work - says it was going to clean up several Gb of files, but when I clicked to continue they were still there.

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    Try to use Task Scheduler to clean up the temporary files.
    Firstly open the control panel, type in Task Scheduler then open this system app. In the right action windows, create a new task:

    After setting the Triggers tab which means when to call the action, move to the Actions tab and create a new one.

    In the script entry, type in the power shell app's file path. Here mine is %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe. Then in the arguments entry, enter the custom power shell file's path. Here I created a Test.ps1 in my D disk: -ExecutionPolicy ByPass -noexit d:\Test.ps1
    At last in the ps1 file, write the clean up code like: Remove-Item "D:\TestFolder\*". It means remove all the files in the TestFolder, you can change it to your temporary folder's name.
    After setting this, the Task Scheduler will trigger the action(remove caches files) we set above when the time which we set in the triggers tab comes.

  • SmartmanAppsSmartmanApps AUMember ✭✭

    @LandLu Thanks for your response, but that isn't quite what I meant (especially given that many files don't delete anyway, thus necessitating doing it manually). I'm sure I saw on twitter ages ago someone mentioned some command that would clean-up all the temp files generated by Visual Studio, so I was wondering what that command is (I didn't take note at the time, and I'm not even sure who it was, and as I said it was ages ago).

Sign In or Register to comment.