Discussion Locked

Error deleting file

0 helpful
13 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm running a Win NT 4.0 with service pack 6. There are two file i can't delete this the error i get.

Cannot delete file: filename you specified is invalid or too long. Specify a different filename.

Help will be appreciated.

13 replies

by thechas

Either the file name is too long, or the DOS file name does not properly match the Windows file name.

Boot into DOS mode, and manually browse to the folder and delete the file using the DOS name.

Chas

by tduval

Right, but don't boot into dos mode, there is none in NT !
Start, execute, command
Go to your subdir, and use wildcards to delete you file (del someth*.*).
If "Access refused", then this file is in you (IE service loaded).

by ann777

Start --> Run --> Command

cd subdirectory

And keep issuing the cd (change directory) command with a space and the next subdirectory until you see the filename (with the dir command)that you want to delete...

Then

del progra~1.ext

Use only the first six charachers of the real filename and then use the ~1 and then the dot and real extension.

That should delete the offending file (unless the file is being used by the operating system). If the OS is using the file, then you need to stop the service that uses this file before deleting the file.

by jcbrito_77

Access is denied
I tried to del the file in DOS mode no luck. The file name starts with con. and it ends with .jpeg
this is what I tried in DOS mode

I'm in the directory which the file is in I do a
DEL *.*
ACCESS IS DENIED

There is only one file in that folder so I try deleting every thing in there. Again it has a weird name that starts with con. and ends with a .jpeg extention.
Also tried

DEL *.JPG
ACCESS IS DENIED

Help will be appreciated

by ann777

You didn't tell us the file is named con!!!!

In fact, no Win32 tool will delete certain files that are considered part of console (con or nul).

One possible solutions is to use non-Win32 tools. For instance, the Resource Kit contains POSIX utilities such as rm.exe, which should allow you to delete the file:
c:\NTReskit\posix\rm con.jpg
(rm is remove or the unix equivalent of del)

There is an easier way, without using reskit and non-native subsystems which is to rename the file then just delete:

C:\> ren \\.\c:\con.jpg trash.jpg
C:\> del trash.jpg

The problem for you is that something is using the file (thus the "access denied"). Have you tried stopping all services, renameing the file (as above), and then deleteing it and starting the services back up?

If the above does not work, then I haven't got any more ideas. Sorry.

by ann777

One more thing to try :

del "d:\wherever\this\file\is\con.jpg"

notice the encased quotes

by jcbrito_77

I did every thing you mentioned above nothing worked. I restarted the system and when the system came back on the file weren?t there any more sound weird but the files are gone.The first thing I did when I wasn't unable to delete the file was check them for viruses. So will give you the point for helping me
Thanks

This discussion is closed to new replies.