Question How to prevent files getting automatically deleted from PC?

Please provide comments and solutions that are helpful to the author of this topic.

zkSnark

Level 5
Thread author
Verified
Well-known
Jan 13, 2019
203
Few days back, I had updated my Windows 11 laptop to the latest update "2023-10 Cumulative Update Preview for Windows 11 Version 23H2 for x64-based Systems (KB5031455)" via Windows Update. After few hours, when I used the laptop, found out that all my files and folders in D: drive had been automatically deleted, except for the "Users" folder in there. Nothing was deleted from C: drive.

I use Kaspersky AV as well as the default Windows Security is also enabled all the time. Unfortunately, Kaspersky expired a day before the Windows update. However, Windows Defender was active at that time.
I don't know whether the update deleted all the files in D: drive but nothing in C: drive.

So, after this incident, I am trying to find out if there is any way to prevent files from getting automatically deleted? Beside the AV, do I need to install any other programs or configure my PC so that no files are deleted automatically in future?
 

Ink

Administrator
Verified
Staff Member
Well-known
Jan 8, 2011
22,393
  1. Opt-out from Optional Updates
  2. Check for Known Issues before updating.

EDIT:
Double-check to see if Files weren't moved from D:/ to C:/ drive.

Can you share more details about the D:/ drive?

Were the files related to OneDrive or another cloud-storage solution?

What types of files were lost? Are you able to recover them from a backup?
 

zkSnark

Level 5
Thread author
Verified
Well-known
Jan 13, 2019
203
  1. Opt-out from Optional Updates
  2. Check for Known Issues before updating.

EDIT:
Double-check to see if Files weren't moved from D:/ to C:/ drive.

Can you share more details about the D:/ drive?

Were the files related to OneDrive or another cloud-storage solution?

What types of files were lost? Are you able to recover them from a backup?
I save all files (documents, images, videos) in D: drive. C: drive has only OS programs and files. I was not using One drive, but only Google Drive. No files were moved to C: drive. Luckily, I was able to recover deleted files using a file recovery program.
 

TairikuOkami

Level 35
Verified
Top Poster
Content Creator
Well-known
May 13, 2017
2,437
I am trying to find out if there is any way to prevent files from getting automatically deleted?
Take ownership of D and deny or remove SYSTEM permissions, but denying WRITE/MODIFY and keeping only READ will do. I always do it, since it can prevent ransomware.
To be 100% sure, you can deny WRITE/MODIFY for all users, but you would have to restore permissions every time you would want to change anything.
Code:
takeown /s %computername% /u %username% /f D: /r /d y
icacls D: /inheritance:r
icacls D: /grant:r %username%:(OI)(CI)F /t /l /q /c
icacls D: /grant "System":(OI)(CI)RX /t /l /q /c
icacls D: /grant "Users":(OI)(CI)RX /t /l /q /c

capture_11222023_161402.jpg
 

zkSnark

Level 5
Thread author
Verified
Well-known
Jan 13, 2019
203
Take ownership of D and deny or remove SYSTEM permissions, but denying WRITE/MODIFY and keeping only READ will do. I always do it, since it can prevent ransomware.
To be 100% sure, you can deny WRITE/MODIFY for all users, but you would have to restore permissions every time you would want to change anything.
Code:
takeown /s %computername% /u %username% /f D: /r /d y
icacls D: /inheritance:r
icacls D: /grant:r %username%:(OI)(CI)F /t /l /q /c
icacls D: /grant "System":(OI)(CI)RX /t /l /q /c
icacls D: /grant "Users":(OI)(CI)RX /t /l /q /c

View attachment 279839
So, with this method, do I have to restore permission each time I edit any documents or save any files in D: drive? Seems like inconvenience for a daily use laptop.
 

monkeylove

Level 10
Verified
Well-known
Mar 9, 2014
459
Also, please check the Google Drive settings, e.g., the drive letter for Google Drive, if your streaming or mirroring, etc.
 
  • Like
Reactions: zkSnark

About us

  • MalwareTips is a community-driven platform providing the latest information and resources on malware and cyber threats. Our team of experienced professionals and passionate volunteers work to keep the internet safe and secure. We provide accurate, up-to-date information and strive to build a strong and supportive community dedicated to cybersecurity.

User Menu

Follow us

Follow us on Facebook or Twitter to know first about the latest cybersecurity incidents and malware threats.

Top