Can't delete a file on Windows 2003 NTFS disk

G

Guest

Hi,
I have a .txt file on a NTFS partition that doesn't have a Security tab
under properties so I can't delete that file. I receive access denied if I
try to open or delete the file.
I tried cacls to add ACLs to the file but still having Access denied.

How can I remove that file
Thanks
 
J

Jim Byrd

Hi Niavlys - You don't state the reason access is denied - in use, security,
etc., and I assume you've already tried to delete it from Safe mode.
However, a program called Copylock, here,
http://noeld.com/programs.asp?cat=misc#CopyLock can often aid in the
process of "replacing, moving, renaming or deleting one or many files which
are currently in use (e.g. system files like comctl32.dll, or virus/trojan
files.)" Another is Killbox, here:
http://www.downloads.subratam.org/KillBox.zip. Both are free and
Recommended. Perhaps one of these may help.

--
Please respond in the same thread.
Regards, Jim Byrd, MS-MVP



In
 
G

Guest

Thanks for the answer.

I tried the 2 utilities without good results. Both told me that the file
does not exist, even if the file is there. If I go in the file properties,
there is no Security and Summary tab. The file was created with vbscript
OpenTextFile method from the file system object.

Niavlys.
 
J

Jim Byrd

Hi Niavlys - In a Cmd box change to the directory containing the errant
file. Then, courtesy of Dave Patrick: Try prepending the path w/ \\.\

Ex:

del \\.\Drive:\directory\*.*
(Note: the period between \\ and \)

This syntax bypasses the reserved word check allowing you to delete.


--
Please respond in the same thread.
Regards, Jim Byrd, MS-MVP



In
 
G

Guest

I already tried that solution from a Microsoft knowledge base article and it
does the same results. It doen't seem to be an issue with the file name but
with the permissions that I can't look at.

Thanks
 
E

Enkidu

I already tried that solution from a Microsoft knowledge base article and it
does the same results. It doen't seem to be an issue with the file name but
with the permissions that I can't look at.
Have you tried taking ownership as Administator?

http://support.microsoft.com/default.aspx?scid=kb;en-us;288292

That's for NT$ but cacls still exists. I've not checked if it actually
does what you require.

Also:

http://support.microsoft.com/default.aspx?scid=kb;en-us;320046

This needs activeperl though,

Cheers,

Cliff
 
G

Guest

Hi,
I can't take ownership, I don't see the security tab.

I tried the script and it returned an Access denied again.

Thanks
 
J

Jim Byrd

Hi Niavlys - In a message in microsoft.public.win2000.registry, here:
Andrew Aronoff posted the
following which might also work for your situation - worth a try:


Andrew Aronoff... wrote...

Jerold Schulman generously responded:
... Use tip 8107 in the 'Tips & Tricks' at http://www.jsiinc.com

Unfortunately, tip 8107 pertains to the third party app,
"MOVEFILE.EXE" by Sysinternals.

However, using MOVEFILE allowed me to understand the syntax for
deleting a file with PendingFileRenameOperations and how to achieve it
with REGEDIT/REGEDT32.

1. Start REGEDT32 (W2K) or REGEDIT (WXP) and navigate to:
HKLM\System\CurrentControlSet\Control\Session Manager

2. W2K: Edit, Add Value..., Data Type: REG_MULTI_SZ, Value Name:
PendingFileRenameOperations, OK

WXP: Edit, New, Multi-String Value, [enter]
PendingFileRenameOperations

3. In the Data area, enter "\??\" + filename to be deleted. LFNs may
be entered without being embedded in quotes. To delete "C:\Long
Directory Name\Long File Name.exe", enter the following data:

\??\C:\Long Directory Name\Long File Name.exe

Then press OK.

4. The "destination file name" is a null (zero) string. It is entered
as follows:

W2K: Edit, Binary, select Data Format: Hex, click at the end of the
hex string, enter 0000 (four zeros), OK.

WXP: Right-click the value, choose "Modify Binary Data", click at the
end of the hex string, enter 0000 (four zeros), OK.

5. Close REGEDT32/REGEDIT and reboot to delete the file.

regards, Andy
--
**********

Please send e-mail to: usenet (dot) post (at) aaronoff (dot) com

**********

--
Please respond in the same thread.
Regards, Jim Byrd, MS-MVP



In
 
J

Jim Byrd

Hi Niavlys - Some further thoughts -

Are you normally logged on as a user (with whatever privileges)? If so, try
logging on as Administrator and see if you can then delete the file.

Second, similar problems have been reported as the result of having a
trailing blank in the folder name. Take a look at these threads:
http://groups.google.com/groups?hl=...c4022d%24f1cca100%24a001280a%40phx.gbl&rnum=5

http://groups.google.com/groups?hl=...selm=%23WkL7BIaBHA.2120%40tkmsftngp02&rnum=15

--
Please respond in the same thread.
Regards, Jim Byrd, MS-MVP



In
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top