Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleting file from C:/ProgramData in Windows 7 does not really delete the file?

I have a little problem with my application. Application stores a SQLite database in C:\ProgramData\ProgramName\ folder on first run. I wanted to test if I delete the database, can application create a new database. On startup, I check if file exists using FileExists(filename) function from SysUtils. But it returns always True, even if I deleted the ProgramName folder.

If I use another folder (for example %AppData%), then it's all OK.

What I'm missing here? Why FileExists function returns always True?

like image 763
evilone Avatar asked Jul 18 '11 11:07

evilone


People also ask

Is it safe to delete C :\ ProgramData package cache?

Microsoft warns against deleting them because these caches contain installer files for various applications on your computer that are useful for repairing, uninstalling, modifying, or reinstalling programs. If you delete the caches, Windows may not be able to carry out these modification operations.

Can I delete files in C :\ ProgramData?

Can I delete the folder C:\ProgramData\Package Cache\? Yes, you can delete that folder. Personally, I would recommend that you do not delete anything in the ProgramData folder, but you can absolutely delete anything you want.

How do I delete a file that won't delete Windows 7?

To do this, start by opening the Start menu (Windows key), typing run, and hitting Enter. In the dialogue that appears, type cmd and hit Enter again. With the command prompt open, enter del /f filename, where filename is the name of the file or files (you can specify multiple files using commas) you want to delete.

How do I get rid of files that won't delete?

One is simply using the delete option, and the other one is deleting files permanently. When you can't delete a file normally, you can delete undeletable files Windows 10 by selecting the target file or folder and then press Shift + Delete keys on the keyboard for a try.


1 Answers

Standard users (and that includes administrators when UAC is active) do not have delete rights to that location.

You need to find a different location to store the file if you need standard users to be able to delete it.

like image 88
David Heffernan Avatar answered Oct 12 '22 19:10

David Heffernan