How to remove temporary files after reboot on Windows?
Ubuntu deletes temporary files by default after reboot, but Windows doesn't. How to make Windows to do the same?
windows temporary-files
add a comment |
Ubuntu deletes temporary files by default after reboot, but Windows doesn't. How to make Windows to do the same?
windows temporary-files
IE temp files or windows temp files? ( %temp% folder)
– Lorenzo Von Matterhorn
Mar 18 '13 at 11:04
%TEMP% (c:usersuserappdatalocaltemp)
– mystdeim
Mar 18 '13 at 11:06
4
Linux has two temporary folders: /tmp gets wiped at reboot, /var/tmp doesn't. In Windows, it's harder to decide which files can be deleted safely. I have seen applications that even stored their executable in the temporary folder (a driver, IIRC, and no, it wasn't malware). Deleting only temporary files that haven't been accessed for X days would probably be a better approach.
– Dennis
Mar 18 '13 at 11:51
1
Why would one do it at every startup? That's a waste of time. Plan to do such cleanup once a week or month.
– Robert Niestroj
Mar 18 '13 at 18:44
You may run into trouble deleting files with the extension "etiqls" ("sqlite" backwards) since they are usually kept in that folder and are locked. They are used by anti-virus and some other software, and are fine to skip.
– Rod Boev
Mar 18 '17 at 16:55
add a comment |
Ubuntu deletes temporary files by default after reboot, but Windows doesn't. How to make Windows to do the same?
windows temporary-files
Ubuntu deletes temporary files by default after reboot, but Windows doesn't. How to make Windows to do the same?
windows temporary-files
windows temporary-files
edited Mar 18 '13 at 12:27
Joachim Sauer
885612
885612
asked Mar 18 '13 at 11:00
mystdeim
305159
305159
IE temp files or windows temp files? ( %temp% folder)
– Lorenzo Von Matterhorn
Mar 18 '13 at 11:04
%TEMP% (c:usersuserappdatalocaltemp)
– mystdeim
Mar 18 '13 at 11:06
4
Linux has two temporary folders: /tmp gets wiped at reboot, /var/tmp doesn't. In Windows, it's harder to decide which files can be deleted safely. I have seen applications that even stored their executable in the temporary folder (a driver, IIRC, and no, it wasn't malware). Deleting only temporary files that haven't been accessed for X days would probably be a better approach.
– Dennis
Mar 18 '13 at 11:51
1
Why would one do it at every startup? That's a waste of time. Plan to do such cleanup once a week or month.
– Robert Niestroj
Mar 18 '13 at 18:44
You may run into trouble deleting files with the extension "etiqls" ("sqlite" backwards) since they are usually kept in that folder and are locked. They are used by anti-virus and some other software, and are fine to skip.
– Rod Boev
Mar 18 '17 at 16:55
add a comment |
IE temp files or windows temp files? ( %temp% folder)
– Lorenzo Von Matterhorn
Mar 18 '13 at 11:04
%TEMP% (c:usersuserappdatalocaltemp)
– mystdeim
Mar 18 '13 at 11:06
4
Linux has two temporary folders: /tmp gets wiped at reboot, /var/tmp doesn't. In Windows, it's harder to decide which files can be deleted safely. I have seen applications that even stored their executable in the temporary folder (a driver, IIRC, and no, it wasn't malware). Deleting only temporary files that haven't been accessed for X days would probably be a better approach.
– Dennis
Mar 18 '13 at 11:51
1
Why would one do it at every startup? That's a waste of time. Plan to do such cleanup once a week or month.
– Robert Niestroj
Mar 18 '13 at 18:44
You may run into trouble deleting files with the extension "etiqls" ("sqlite" backwards) since they are usually kept in that folder and are locked. They are used by anti-virus and some other software, and are fine to skip.
– Rod Boev
Mar 18 '17 at 16:55
IE temp files or windows temp files? ( %temp% folder)
– Lorenzo Von Matterhorn
Mar 18 '13 at 11:04
IE temp files or windows temp files? ( %temp% folder)
– Lorenzo Von Matterhorn
Mar 18 '13 at 11:04
%TEMP% (c:usersuserappdatalocaltemp)
– mystdeim
Mar 18 '13 at 11:06
%TEMP% (c:usersuserappdatalocaltemp)
– mystdeim
Mar 18 '13 at 11:06
4
4
Linux has two temporary folders: /tmp gets wiped at reboot, /var/tmp doesn't. In Windows, it's harder to decide which files can be deleted safely. I have seen applications that even stored their executable in the temporary folder (a driver, IIRC, and no, it wasn't malware). Deleting only temporary files that haven't been accessed for X days would probably be a better approach.
– Dennis
Mar 18 '13 at 11:51
Linux has two temporary folders: /tmp gets wiped at reboot, /var/tmp doesn't. In Windows, it's harder to decide which files can be deleted safely. I have seen applications that even stored their executable in the temporary folder (a driver, IIRC, and no, it wasn't malware). Deleting only temporary files that haven't been accessed for X days would probably be a better approach.
– Dennis
Mar 18 '13 at 11:51
1
1
Why would one do it at every startup? That's a waste of time. Plan to do such cleanup once a week or month.
– Robert Niestroj
Mar 18 '13 at 18:44
Why would one do it at every startup? That's a waste of time. Plan to do such cleanup once a week or month.
– Robert Niestroj
Mar 18 '13 at 18:44
You may run into trouble deleting files with the extension "etiqls" ("sqlite" backwards) since they are usually kept in that folder and are locked. They are used by anti-virus and some other software, and are fine to skip.
– Rod Boev
Mar 18 '17 at 16:55
You may run into trouble deleting files with the extension "etiqls" ("sqlite" backwards) since they are usually kept in that folder and are locked. They are used by anti-virus and some other software, and are fine to skip.
– Rod Boev
Mar 18 '17 at 16:55
add a comment |
5 Answers
5
active
oldest
votes
Instead of going through the trouble (and danger) of doing this manually, I would recommend a program like CCleaner which can automate this process and leaves alone files that were created within the last 24 hours.
This is quite important, since some programs that might also run on startup could already be using temporary files, potentially causing issues. On Linux, the /tmp directory is known to be cleared out on every reboot, and all Linux programs are therefore designed around that principle.
Here's how to make CCleaner start with Windows:

Make sure only "Temporary Files" and other things you really want to clear on every startup are checked:

CCleaner should only delete files over a day old by default, but it doesn't hurt to check this setting:

After all this is done, CCleaner should run quietly in the notification area at every startup. The icon will disappear when cleaning is complete.

CCleaner was infected once. That's one reason it's always better to use builtin functions, than installing 3rd party apps for such a trivial task.
– davidbaumann
Dec 4 at 11:41
add a comment |
I don't think there's an option for that. You can create a .bat file to delete the temporary files and make it run on startup (when Windows starts). The following should work:
Delete all files in %temp% but leave the folders untouched:
@echo off
del /s /f /q "%temp%/*.*"
Delete everything on %temp%:
@echo off
rmdir /s /q %temp%
md %temp%
Delete all .tmp files:
@echo off
del /s /f /q "%temp%/*.tmp"
Be aware that some programs use files in %temp% to run so do this at your own risk.
To make the .bat run on startup follow this tutorial from Microsoft or one of the many others online...
add a comment |
As a matter of fact, it is a waste of processor time to perform such a cleanup every startup.
Instead, add a scheduled task, triggered once a week to execute a batch located in the same directory of ccleaner, containing:
ccleaner /AUTO
This will perform a scan and automatic cleanup without any prompts to all boxes ticked on ccleaner and WILL include user-specified directories. (does not perform registry fixes)
extra tip: on batch properties, you may even select it to run minimized, so it bothers you less on the startup; the scan will be rather quick and probably you wont even notice the minimized window.
1
Is there some evidence that this is a factual matter? o.O
– Smithers
Feb 5 '15 at 18:18
add a comment |
My batch file to remove temporary files older than a day
IF EXIST %TEMP% ( FORFILES /P %TEMP% /D -01 /C "cmd /c IF @isdir==TRUE (rd /s /q @path) else (del /q @path)" )
1
There has been no DOS for a long time
– davidbaumann
Dec 4 at 11:40
add a comment |

You can use the builtin Windows function to cleanup all temporary files (and much more).
Just once, run
CLEANMGR /sageset
Now select anything you want to clean up.
Now by running
CLEANMGR /sagerun
it will exactly run all cleanup jobs as selected.
See more in the Microsoft Knowledgebase.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f567673%2fhow-to-remove-temporary-files-after-reboot-on-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
Instead of going through the trouble (and danger) of doing this manually, I would recommend a program like CCleaner which can automate this process and leaves alone files that were created within the last 24 hours.
This is quite important, since some programs that might also run on startup could already be using temporary files, potentially causing issues. On Linux, the /tmp directory is known to be cleared out on every reboot, and all Linux programs are therefore designed around that principle.
Here's how to make CCleaner start with Windows:

Make sure only "Temporary Files" and other things you really want to clear on every startup are checked:

CCleaner should only delete files over a day old by default, but it doesn't hurt to check this setting:

After all this is done, CCleaner should run quietly in the notification area at every startup. The icon will disappear when cleaning is complete.

CCleaner was infected once. That's one reason it's always better to use builtin functions, than installing 3rd party apps for such a trivial task.
– davidbaumann
Dec 4 at 11:41
add a comment |
Instead of going through the trouble (and danger) of doing this manually, I would recommend a program like CCleaner which can automate this process and leaves alone files that were created within the last 24 hours.
This is quite important, since some programs that might also run on startup could already be using temporary files, potentially causing issues. On Linux, the /tmp directory is known to be cleared out on every reboot, and all Linux programs are therefore designed around that principle.
Here's how to make CCleaner start with Windows:

Make sure only "Temporary Files" and other things you really want to clear on every startup are checked:

CCleaner should only delete files over a day old by default, but it doesn't hurt to check this setting:

After all this is done, CCleaner should run quietly in the notification area at every startup. The icon will disappear when cleaning is complete.

CCleaner was infected once. That's one reason it's always better to use builtin functions, than installing 3rd party apps for such a trivial task.
– davidbaumann
Dec 4 at 11:41
add a comment |
Instead of going through the trouble (and danger) of doing this manually, I would recommend a program like CCleaner which can automate this process and leaves alone files that were created within the last 24 hours.
This is quite important, since some programs that might also run on startup could already be using temporary files, potentially causing issues. On Linux, the /tmp directory is known to be cleared out on every reboot, and all Linux programs are therefore designed around that principle.
Here's how to make CCleaner start with Windows:

Make sure only "Temporary Files" and other things you really want to clear on every startup are checked:

CCleaner should only delete files over a day old by default, but it doesn't hurt to check this setting:

After all this is done, CCleaner should run quietly in the notification area at every startup. The icon will disappear when cleaning is complete.

Instead of going through the trouble (and danger) of doing this manually, I would recommend a program like CCleaner which can automate this process and leaves alone files that were created within the last 24 hours.
This is quite important, since some programs that might also run on startup could already be using temporary files, potentially causing issues. On Linux, the /tmp directory is known to be cleared out on every reboot, and all Linux programs are therefore designed around that principle.
Here's how to make CCleaner start with Windows:

Make sure only "Temporary Files" and other things you really want to clear on every startup are checked:

CCleaner should only delete files over a day old by default, but it doesn't hurt to check this setting:

After all this is done, CCleaner should run quietly in the notification area at every startup. The icon will disappear when cleaning is complete.

edited Mar 18 '13 at 12:00
answered Mar 18 '13 at 11:35
oKtosiTe
6,09183868
6,09183868
CCleaner was infected once. That's one reason it's always better to use builtin functions, than installing 3rd party apps for such a trivial task.
– davidbaumann
Dec 4 at 11:41
add a comment |
CCleaner was infected once. That's one reason it's always better to use builtin functions, than installing 3rd party apps for such a trivial task.
– davidbaumann
Dec 4 at 11:41
CCleaner was infected once. That's one reason it's always better to use builtin functions, than installing 3rd party apps for such a trivial task.
– davidbaumann
Dec 4 at 11:41
CCleaner was infected once. That's one reason it's always better to use builtin functions, than installing 3rd party apps for such a trivial task.
– davidbaumann
Dec 4 at 11:41
add a comment |
I don't think there's an option for that. You can create a .bat file to delete the temporary files and make it run on startup (when Windows starts). The following should work:
Delete all files in %temp% but leave the folders untouched:
@echo off
del /s /f /q "%temp%/*.*"
Delete everything on %temp%:
@echo off
rmdir /s /q %temp%
md %temp%
Delete all .tmp files:
@echo off
del /s /f /q "%temp%/*.tmp"
Be aware that some programs use files in %temp% to run so do this at your own risk.
To make the .bat run on startup follow this tutorial from Microsoft or one of the many others online...
add a comment |
I don't think there's an option for that. You can create a .bat file to delete the temporary files and make it run on startup (when Windows starts). The following should work:
Delete all files in %temp% but leave the folders untouched:
@echo off
del /s /f /q "%temp%/*.*"
Delete everything on %temp%:
@echo off
rmdir /s /q %temp%
md %temp%
Delete all .tmp files:
@echo off
del /s /f /q "%temp%/*.tmp"
Be aware that some programs use files in %temp% to run so do this at your own risk.
To make the .bat run on startup follow this tutorial from Microsoft or one of the many others online...
add a comment |
I don't think there's an option for that. You can create a .bat file to delete the temporary files and make it run on startup (when Windows starts). The following should work:
Delete all files in %temp% but leave the folders untouched:
@echo off
del /s /f /q "%temp%/*.*"
Delete everything on %temp%:
@echo off
rmdir /s /q %temp%
md %temp%
Delete all .tmp files:
@echo off
del /s /f /q "%temp%/*.tmp"
Be aware that some programs use files in %temp% to run so do this at your own risk.
To make the .bat run on startup follow this tutorial from Microsoft or one of the many others online...
I don't think there's an option for that. You can create a .bat file to delete the temporary files and make it run on startup (when Windows starts). The following should work:
Delete all files in %temp% but leave the folders untouched:
@echo off
del /s /f /q "%temp%/*.*"
Delete everything on %temp%:
@echo off
rmdir /s /q %temp%
md %temp%
Delete all .tmp files:
@echo off
del /s /f /q "%temp%/*.tmp"
Be aware that some programs use files in %temp% to run so do this at your own risk.
To make the .bat run on startup follow this tutorial from Microsoft or one of the many others online...
answered Mar 18 '13 at 11:17
Alex
98931429
98931429
add a comment |
add a comment |
As a matter of fact, it is a waste of processor time to perform such a cleanup every startup.
Instead, add a scheduled task, triggered once a week to execute a batch located in the same directory of ccleaner, containing:
ccleaner /AUTO
This will perform a scan and automatic cleanup without any prompts to all boxes ticked on ccleaner and WILL include user-specified directories. (does not perform registry fixes)
extra tip: on batch properties, you may even select it to run minimized, so it bothers you less on the startup; the scan will be rather quick and probably you wont even notice the minimized window.
1
Is there some evidence that this is a factual matter? o.O
– Smithers
Feb 5 '15 at 18:18
add a comment |
As a matter of fact, it is a waste of processor time to perform such a cleanup every startup.
Instead, add a scheduled task, triggered once a week to execute a batch located in the same directory of ccleaner, containing:
ccleaner /AUTO
This will perform a scan and automatic cleanup without any prompts to all boxes ticked on ccleaner and WILL include user-specified directories. (does not perform registry fixes)
extra tip: on batch properties, you may even select it to run minimized, so it bothers you less on the startup; the scan will be rather quick and probably you wont even notice the minimized window.
1
Is there some evidence that this is a factual matter? o.O
– Smithers
Feb 5 '15 at 18:18
add a comment |
As a matter of fact, it is a waste of processor time to perform such a cleanup every startup.
Instead, add a scheduled task, triggered once a week to execute a batch located in the same directory of ccleaner, containing:
ccleaner /AUTO
This will perform a scan and automatic cleanup without any prompts to all boxes ticked on ccleaner and WILL include user-specified directories. (does not perform registry fixes)
extra tip: on batch properties, you may even select it to run minimized, so it bothers you less on the startup; the scan will be rather quick and probably you wont even notice the minimized window.
As a matter of fact, it is a waste of processor time to perform such a cleanup every startup.
Instead, add a scheduled task, triggered once a week to execute a batch located in the same directory of ccleaner, containing:
ccleaner /AUTO
This will perform a scan and automatic cleanup without any prompts to all boxes ticked on ccleaner and WILL include user-specified directories. (does not perform registry fixes)
extra tip: on batch properties, you may even select it to run minimized, so it bothers you less on the startup; the scan will be rather quick and probably you wont even notice the minimized window.
answered Mar 19 '13 at 2:33
Lorenzo Von Matterhorn
2,06911518
2,06911518
1
Is there some evidence that this is a factual matter? o.O
– Smithers
Feb 5 '15 at 18:18
add a comment |
1
Is there some evidence that this is a factual matter? o.O
– Smithers
Feb 5 '15 at 18:18
1
1
Is there some evidence that this is a factual matter? o.O
– Smithers
Feb 5 '15 at 18:18
Is there some evidence that this is a factual matter? o.O
– Smithers
Feb 5 '15 at 18:18
add a comment |
My batch file to remove temporary files older than a day
IF EXIST %TEMP% ( FORFILES /P %TEMP% /D -01 /C "cmd /c IF @isdir==TRUE (rd /s /q @path) else (del /q @path)" )
1
There has been no DOS for a long time
– davidbaumann
Dec 4 at 11:40
add a comment |
My batch file to remove temporary files older than a day
IF EXIST %TEMP% ( FORFILES /P %TEMP% /D -01 /C "cmd /c IF @isdir==TRUE (rd /s /q @path) else (del /q @path)" )
1
There has been no DOS for a long time
– davidbaumann
Dec 4 at 11:40
add a comment |
My batch file to remove temporary files older than a day
IF EXIST %TEMP% ( FORFILES /P %TEMP% /D -01 /C "cmd /c IF @isdir==TRUE (rd /s /q @path) else (del /q @path)" )
My batch file to remove temporary files older than a day
IF EXIST %TEMP% ( FORFILES /P %TEMP% /D -01 /C "cmd /c IF @isdir==TRUE (rd /s /q @path) else (del /q @path)" )
edited Dec 4 at 12:50
Dave M
12.7k92838
12.7k92838
answered Dec 4 at 10:50
Arnaud Grandville
111
111
1
There has been no DOS for a long time
– davidbaumann
Dec 4 at 11:40
add a comment |
1
There has been no DOS for a long time
– davidbaumann
Dec 4 at 11:40
1
1
There has been no DOS for a long time
– davidbaumann
Dec 4 at 11:40
There has been no DOS for a long time
– davidbaumann
Dec 4 at 11:40
add a comment |

You can use the builtin Windows function to cleanup all temporary files (and much more).
Just once, run
CLEANMGR /sageset
Now select anything you want to clean up.
Now by running
CLEANMGR /sagerun
it will exactly run all cleanup jobs as selected.
See more in the Microsoft Knowledgebase.
add a comment |

You can use the builtin Windows function to cleanup all temporary files (and much more).
Just once, run
CLEANMGR /sageset
Now select anything you want to clean up.
Now by running
CLEANMGR /sagerun
it will exactly run all cleanup jobs as selected.
See more in the Microsoft Knowledgebase.
add a comment |

You can use the builtin Windows function to cleanup all temporary files (and much more).
Just once, run
CLEANMGR /sageset
Now select anything you want to clean up.
Now by running
CLEANMGR /sagerun
it will exactly run all cleanup jobs as selected.
See more in the Microsoft Knowledgebase.

You can use the builtin Windows function to cleanup all temporary files (and much more).
Just once, run
CLEANMGR /sageset
Now select anything you want to clean up.
Now by running
CLEANMGR /sagerun
it will exactly run all cleanup jobs as selected.
See more in the Microsoft Knowledgebase.
answered Dec 4 at 11:39
davidbaumann
1,842722
1,842722
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f567673%2fhow-to-remove-temporary-files-after-reboot-on-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
IE temp files or windows temp files? ( %temp% folder)
– Lorenzo Von Matterhorn
Mar 18 '13 at 11:04
%TEMP% (c:usersuserappdatalocaltemp)
– mystdeim
Mar 18 '13 at 11:06
4
Linux has two temporary folders: /tmp gets wiped at reboot, /var/tmp doesn't. In Windows, it's harder to decide which files can be deleted safely. I have seen applications that even stored their executable in the temporary folder (a driver, IIRC, and no, it wasn't malware). Deleting only temporary files that haven't been accessed for X days would probably be a better approach.
– Dennis
Mar 18 '13 at 11:51
1
Why would one do it at every startup? That's a waste of time. Plan to do such cleanup once a week or month.
– Robert Niestroj
Mar 18 '13 at 18:44
You may run into trouble deleting files with the extension "etiqls" ("sqlite" backwards) since they are usually kept in that folder and are locked. They are used by anti-virus and some other software, and are fine to skip.
– Rod Boev
Mar 18 '17 at 16:55