Create undeletable file

I was meddling with my flash drive today, when I discovered quite by accident that should you enable hidden files view, & copy the Desktop.ini file from your Desktop into a folder on your flash drive, that not ONLY will you be unable to delete the file, but it will change the folder name to Desktop as well.

_____

Use unlocker? Pffft! Cannot delete. Would you like to delete on reboot?

Copy another folder desktop.ini to overwrite it? Pfffft! "You need an additional 512 KB to copy these files." 8 GB 0 bytes free (This when 3 or 4 GB were free earlier!)

This shall get interesting. DON'T do what I did, hahahaha!

_____

* How did I get in this mess? I created a Winrar SFX to open a folder on the flash drive for an experiment. It worked great, except I included my Desktop.ini file in the rar file, since it makes you add a file. Technically, I forgot all about the 0 KB file method (Right-click/new archive then SFX the 0kb file), but AVG thinks 0KB Rar containers are some unknown possible trojan.

I couldn't extract to temp folder, else the command would try to run from the temp folder instead of opening the folder I wanted.

Ahhhhhhhhhyayyyyyyyy! Fun, fun, fun! At least this is interesting!

_____

And to note, that this DID work (until it refreshed & set the folder to Desktop + Desktop attrib. Took a minute or so....)

And afterwards, trying to run this file would result in a never-ending loop file that will not stop until you unplug the flash drive.

All because of changing it to Desktop.ini because the rar SFX extracted to the same folder I was running it in, because I did not have it set to extract to a TMP dir, because then it wouldn't open the folder using a relative path, etc, etc.

_____

Post Edit: And since the drive is formatted in UDF, it seems Windows somehow "finalized" or locked it, caused somehow by above process.

So, now, I can copy, but NOT delete files from the flash drive. Interesting. Very interesting. So, I have to copy all my files from the flash drive, re-format it, & copy it back. Hey, I didn't know I COULD set it to read only, lol! Guess I have to experiment some more & see what I can do about this. Who knows? Maybe I'll invent a flash drive lock tool for drives formatted in UDF!

_____

The Fix: I do remember I manually removed the file without safe eject because of the looping file earlier. This seems to be what caused the lockdown. Ran ChkDsk to fix it, & voila! Everything works now.

Seems to "lock the drive" all you have to do is remove it without safe eject, particularly under UDF. And to return it to writable status, simply fix the errors.

Don't really recommend this method of locking it, :P

Tried it on another machine since I have autoruns totally disabled, including auto-insert notification on this one.

That is interesting. To me, at least, might be old news to some but new to me. Glad you got it fixed. So did you fix it back without having to copy, reformat, etc? Just by using chkdsk?

I copied the files over to a folder on the desktop first to be sure, then I ran the CHKDSK util, & it fixed it.

It was quite interesting since, prior to that, the flash drive was "locked" into read only mode, much like you would find on a U3 drive.

After running chkdsk, my free space returned & I was then able to write back to the drive. This led me to wonder if I could create a util to "finalize" the drive for total virus protection, & run it again from the flash drive to "unfinalize" the file system in order to use the drive. UDF file system is different from NTFS, but it still supports gi-huge files & possibly linux/mac (not sure on that yet). It also has been said that it is similar to CDFS, which is what a U3 Drive uses for read only protection from what I am aware of.

I have no idea at the moment where to start with that idea, but it certainly piques my interest enough that I may try something with it later on.