I head about a qbasic program that could make files undeletable... it only worked on ME or something though.
Anybody here happen to have that code:?:

Dani AI

Generated

Short answer: there is no reliable way to make a file "100% undeletable" on modern Windows. asked about a QBasic trick and correctly pointed out attribute changes — but attributes alone are not a true protection.

On NTFS the ability to remove a file is enforced by access control (DELETE on the file or delete-child on the parent folder), not by the read-only bit. That means anyone with the necessary ACL rights or with administrative control (or who can take ownership or mount the disk offline) can remove the file. For the Windows access-right model see .

Ways to make deletion harder (not absolute):

  • Use NTFS ACLs to deny Delete/delete-child for normal users and restrict ownership to SYSTEM or an administrative service. This raises the bar but can be undone by an admin.
  • Keep the file open from a service/process that denies delete sharing while running. This blocks deletion while the handle exists but is transient.
  • Implement a file-system filter or kernel driver to intercept delete requests — robust but complex, requires signing and can be treated as malware by security tools.
    QBasic (16-bit DOS) cannot manipulate NTFS ACLs or install kernel filters; on Win9x/FAT it could only flip attributes, so any "undeletable" QBasic trick from the ME era would be limited and easily bypassed on NT-based systems.

If a file on a modern system resists deletion: check the file owner and ACLs, look for open handles with tools such as Process Explorer, or boot from recovery media and remove/reset ACLs (using built-in tools or by editing offline). For ACL tools see the icacls documentation and for handle inspection see Process Explorer. Avoid using these techniques to hide malicious code; they are commonly abused by malware.

Recommended Answers

All 2 Replies

I head about a qbasic program that could make files undeletable... it only worked on ME or something though.
Anybody here happen to have that code:?:

I don't know what OS this will/will not work on. Should work on
95,98,NT,ME

using shell "attrib +- attribute filename"
+r sets read-only attribute (which may be what you want)
-r removes read-only

+a sets archive attribute
-a removes it

+h sets hidden attrib
-h removes it

+s set system attrib
-s removes it

Well, I heard about a QBasic file that made a file 100% undeletable... no hatter how you changed the file properties... I'd imaging it would make viruses extremely hard to exterminate(:D not that I'm trying to make viruses) just want to know... I am curios about lotsa stuff.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.