View Full Version : File.Delete bug
Solmos
12-20-2007, 01:50 PM
File.Delete(_WindowsFolder.."\\Prefetch\\*.*", false, false, true, nil);
Error deleting one o more files... (not is deleted any file)
The files in this folder is not in use... manual deleting is very easy but with ams7 fails... :huh:huh
Might need more information on this:
- What OS are you running this on?
- User account or Admin account?
- Is the folder protected?
- Did you create that folder?
- What type of files inside the folder?
- Are there any sub folders?
Are you using the latest version of AutoPlay?
Adam Kapilik
Solmos
12-20-2007, 02:35 PM
Hi
Windows XP profesional Service pak 2
AMS 7
user account (admin privilegies)
the folder is C:\windows\prefetch
No modification in this folder, default by windows.
th file tipes is *.pf (113 files found) and one file *.ini
any is deleted...
No subfolders in this folder..
thx
Solmos,
Try this
pFILES = File.Find(_WindowsFolder.."\\Prefetch", "*.*", false, false, nil, nil);
for E, pFILE in pFILES do
File.Delete(pFILE, false, false, false, nil);
end
Solmos
12-21-2007, 06:36 AM
tested and Not work...
Any file is deleted... :huh:huh
Well I haven't tried the code here Solmos, the code should have worked fine though.
If you don't mind me asking, what are the files in "Prefetch" ? How come they aren't necessary in one's computer ?
Solmos
12-21-2007, 12:36 PM
the prefetch files (*.pf) is not necesary because is a backup of the programs...
Pleae, tests your code in your system...
In my system file.delete works good, but not work deleting files in prefetch folder...
This is a BUG!!! of AMS7 (and AMS6...)... please update AMS7...
the prefetch files (*.pf) is not necesary because is a backup of the programs...
These files are not backup files, but files specially ordered on a disk in order to improve speed of loading prefeched applications in Windows (Windows Media Player, Internet Explorer and so on). There is absolutely no reason for you to delete them, since they will be recreated the next time you run your applications.
Solmos,
Well perhaps they are files that are sort of protected since they are files that are needed in order to improve speed performance / backup
Solmos
12-21-2007, 11:23 PM
No, they are not protected files system ...
And no, it is not needed. It is simply cache.
These files can be deleted without any problem.
And even if they were protected files in the system, there is not any reason that AMS7 if I do a function to delete them, not delete them.
And I need to erase NOW!
I expect an update or a scrip staff indigorose early to remove them ...
Dermot
12-22-2007, 02:10 AM
And I need to erase NOW!
Then just delete them manually, although I don't know why you are so desperate to delete them. I checked the size of my Prefetch folder and it is only 4.5 mb so those files don't take up much space.
Solmos
12-22-2007, 04:22 AM
Because I try to convince me that not delete these files? Or do so manually?
Instead of saying stupidities, and try to convince me that it manually delete! BUSCÁIS WHY NOT A SOLUTION TO THIS BUG?
DELETING NEED NOW! WITH AMS7, no matter why and for that!
What matters that AMS7 THE FAILURE TO DELETE!
If the product is defective that I returned the money! Or take an update to resolve the BUG NOW!
Indigorose, I think you should return the money to this very unpleasant and uninformed guy.
The APMS returns an error code 1024 when trying to delete those files. It is obvious that Windows do not allow you to mess with these files. Windows Explorer and Command Prompt must be using some other approach when deleting contents of this specific folder, most likely some specific Windows API call. There is no reason what-so-ever that APMS File.Delete action would fail on this one folder only. By the way, this could be a Lua issue as well.
Mark Russinovich and David Solomon, big time kernel experts have explained the Prefetch functionality here:
http://msdn.microsoft.com/msdnmag/issues/01/12/XPKernel/default.aspx
There is also Ed Bott's article here:
http://www.edbott.com/weblog/archives/000024.html
Solmos
12-22-2007, 06:01 AM
ok thanks Bule
But I do not understand why the AMS could not erase (or failure) those files .. is or not a BUG?
I need to remove the AMS, because I am creating a program to clean the system style ccleaner ..
http://img206.imageshack.us/img206/3082/dibujovvxi7.png
I lack the option of cleaning the prefetch and an option to clear the clipboard ... (but clear clipboar not is possible with AMS...:-( )
What I have done others
Any suggestions??
THX
Well then, run a minimized command prompt like this to delete those data:
File.Run("cmd.exe", "/c del /F /Q \"%windir%\\Prefetch\\*.*\"", "", SW_MINIMIZE, true);
To clear the clipboard, enable the Clipboard plugin and simply copy an empty string to it:
Clipboard.CopyText("");
There is no reason to yell.
Solmos
12-22-2007, 10:43 AM
:yes:yes:yes
Very very thanks
But the "temporals" solutions, Have a problem, and that is that the copy text from clipboard, it does not eliminate the text carries the clipboard, by giving the right button still appears "paste" is not a valid solution, because it really still contains text ...
And the code to delete files prefetch works very well, but leaves "cmd.exe" in the prefetch folder ... So that neither would be a valid solcuion ..
But as temporary solutions until they settle the BUG of AMS7 is fine, thank you.
And the code to delete files prefetch works very well, but leaves "cmd.exe" in the prefetch folder ... So that neither would be a valid solcuion ..
But what is the point of deleting the entire contents of the prefetch folder when it will ultimately REDUCE SYSTEM PERFORMANCE?
The command does not 'leave' the cmd.exe in the prefetch folder, but is actually being placed there after the command finishes it's work by the Windows OS itself. There is no reason to clean stuff just for the purpose of doing the act of cleaning; the purpose is to increase system performace, and you, by telling people that clearing prefetch folder will do so, or making them think that those files are crap, are lying to them.
Solmos
12-22-2007, 01:24 PM
No no...
in all system cleaners, this option is available...
In my program, is uncheked by default...
Powered by vBulletin™ Version 4.0.6 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.