Answer the question
In order to leave comments, you need to log in
How to automate the cleanup of TEMP folders?
Hello Khabrovites!
Answer the question
In order to leave comments, you need to log in
1. She cleans herself anyway.
2. The Windows Scheduler allows you to create tasks that will respond to specific events, such as the entry or exit (possibly) of a user. Create a batch or cmd script to clean up the directory. We create a task in the scheduler, select an event and a script.
3. Cleaning up at logout is a very bad idea because the session is ending, and you want to multiply tasks. The task can be forced to end without completing its task or slow down the shutdown.
I create one folder C:\Temp
, the rest
C:\ProgramData\Temp
C:\Users\tsk\AppData\Local\Temp
C:\Users\tsk\AppData\LocalLow\Temp
C:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp
C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp
C:\Windows\Temp
SET TEMP=C:\Temp\
SET TMP=C:\Temp\
echo ------ clear TEMP
del /S /Q %TEMP%\*.*
rmdir /S /Q %TEMP%
rmdir /q /s "H:\msdownld.tmp"
powershell -NoLogo -command "& Clear-RecycleBin -force" 2>NUL
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question