Answered by:
Temp file (~) not getting removed.

Question
-
Hi Guys,
Is there any way to automatically remove the temp file which gets created when any word or excel document is opened. Users are complaining that they see lots of old temp file (~$filename.xxx) in their shared folder. Pls let me know. I can just hide the system files from the folder options which will hide the files. But that is not the ideal solution.
Thank you.
Wednesday, September 14, 2016 1:51 PM
Answers
-
WARNING: THIS WILL DELETE THE FILES THAT MATCHES ~*.extension IN THE FOLDER YOU SPECIFY. ME AND MY CODE ARE NOT RESPONSIBLE FOR ACCIDENTAL DELETION OF FILES AND THIS SHOULD BE USED AT YOUR OWN RISK
You could use powershell to help you delete those files.
$path = "C:/Some_Folder/Some_oother_folder/Some_Folder/~*.extension" Get-ChildItem -path $path -Recurse | Remove-Item
Julio Sanchez-Tirado http://scriptomato.com co-founder | CEO | Pitcher
- Proposed as answer by Tony_Tao Tuesday, September 20, 2016 8:25 AM
- Marked as answer by Teemo TangMicrosoft contingent staff Saturday, September 24, 2016 5:21 AM
Wednesday, September 14, 2016 2:43 PM
All replies
-
WARNING: THIS WILL DELETE THE FILES THAT MATCHES ~*.extension IN THE FOLDER YOU SPECIFY. ME AND MY CODE ARE NOT RESPONSIBLE FOR ACCIDENTAL DELETION OF FILES AND THIS SHOULD BE USED AT YOUR OWN RISK
You could use powershell to help you delete those files.
$path = "C:/Some_Folder/Some_oother_folder/Some_Folder/~*.extension" Get-ChildItem -path $path -Recurse | Remove-Item
Julio Sanchez-Tirado http://scriptomato.com co-founder | CEO | Pitcher
- Proposed as answer by Tony_Tao Tuesday, September 20, 2016 8:25 AM
- Marked as answer by Teemo TangMicrosoft contingent staff Saturday, September 24, 2016 5:21 AM
Wednesday, September 14, 2016 2:43 PM -
As Julio Sanchez-Tirado mentioned, please try it.
Please remember to mark the replies as an answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
- Proposed as answer by Tony_Tao Tuesday, September 20, 2016 8:25 AM
Thursday, September 15, 2016 5:55 AM -
Hi,
We haven’t heard from you for a couple of days, have you solved the problem? How about the solution we have provided? We are looking forward to your good news.
Best Regards,
Tao
Please remember to mark the replies as an answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
Tuesday, September 20, 2016 8:25 AM