A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Creation of files that can't be deleted



 
 
Thread Tools Display Modes
  #1  
Old November 21st 10, 01:41 PM posted to microsoft.public.windowsxp.general
Mint
external usenet poster
 
Posts: 298
Default Creation of files that can't be deleted

Windows allows the creation of file names and folder names that can
not be deleted or renamed via Windows Explorer.
This includes names with invalid characters and names that are too
long.

Is this true?

Windows allows the creation of file names and folder names that can
not be deleted or renamed via Windows Explorer.
This includes names with invalid characters and names that are too
long.
The current version of PATH TOO DEEP Fixer includes a function to scan
for invalid names and too-long names.
Ads
  #2  
Old November 21st 10, 07:36 PM posted to microsoft.public.windowsxp.general
Don Phillipson[_4_]
external usenet poster
 
Posts: 1,185
Default Creation of files that can't be deleted

"Mint" wrote in message
...

Windows allows the creation of file names and folder names that can
not be deleted or renamed via Windows Explorer.
This includes names with invalid characters and names that are too
long. Is this true?


This seems likely. Ever since MS-DOS and CP/M OS programmers
have been promulgating rules that user experience later proves to be
not quite comprehensive.

But I have never come across a filename that Windows refused to
delete that could not be deleted from a DOS prompt.

--
Don Phillipson
Carlsbad Springs
(Ottawa, Canada)


  #3  
Old November 22nd 10, 01:13 AM posted to microsoft.public.windowsxp.general
Tester[_2_]
external usenet poster
 
Posts: 341
Default Creation of files that can't be deleted



Mint wrote:
Windows allows the creation of file names and folder names that can
not be deleted or renamed via Windows Explorer.
This includes names with invalid characters and names that are too
long.

Is this true?


No it is not true. One can always delete any files or folders using
Windows Explorer if one knows what one is doing and one has the
Administrator rights if one is required.

hth
  #4  
Old November 22nd 10, 01:26 AM posted to microsoft.public.windowsxp.general
Nil[_2_]
external usenet poster
 
Posts: 2,170
Default Creation of files that can't be deleted

On 21 Nov 2010, Tester wrote in
microsoft.public.windowsxp.general:

No it is not true. One can always delete any files or folders using
Windows Explorer if one knows what one is doing and one has the
Administrator rights if one is required.


That is not accurate. Windows' file system is quite capable of carrying
a file with a name that Explorer can't deal with, especially if the
file name contains illegal characters or if the path is too long.
  #5  
Old November 22nd 10, 01:31 AM posted to microsoft.public.windowsxp.general
Tester[_2_]
external usenet poster
 
Posts: 341
Default Creation of files that can't be deleted



Nil wrote:
On 21 Nov 2010, Tester wrote in
microsoft.public.windowsxp.general:

That is not accurate. Windows' file system is quite capable of carrying
a file with a name that Explorer can't deal with, especially if the
file name contains illegal characters or if the path is too long.



No it is not true. One can always delete any files or folders using
Windows Explorer *if one knows what one is doing* and one has the
Administrator rights if one is required.

  #6  
Old November 22nd 10, 10:41 AM posted to microsoft.public.windowsxp.general
Jose
external usenet poster
 
Posts: 3,140
Default Creation of files that can't be deleted

On Nov 21, 8:41*am, Mint wrote:
Windows allows the creation of file names and folder names that can
not be deleted or renamed via Windows Explorer.
This includes names with invalid characters and names that are too
long.

Is this true?

Windows allows the creation of file names and folder names that can
not be deleted or renamed via Windows Explorer.
This includes names with invalid characters and names that are too
long.
The current version of PATH TOO DEEP Fixer includes a function to scan
for invalid names and too-long names.


If you would have provided an example, there might be better or more
details about how to delete these things.

However, it made me think of this and these notes about what some
people notice on their systems regarding peculiar looking folders
appearing that are stubborn to delete and are not understood:

When some programs (including Windows programs) installs things, it
may create a temporary folder consisting of 20-30 random letters and
numbers in the root drive of the volume with the most free space.
This explains why sometimes the folders are on your C drive or on some
other drive - which one has the most free space?

For example you may see a folder similar to or called:

D:\9470bb12e8a4f3447657236478e41c5

There may be other folders and files under that main temporary
folder.

These should normally be removed when the installation is complete,
but sometimes they are not - especially if the installation fails.
They are harmless but annoying. You may think something is wrong when
there is not or be afraid the files are really needed. To avoid
confusion you can delete the temporary folders.

If your installation failed or the installation does not delete the
randomly named folder when it cleans up, running the installation
again to try to get rid of the folder will make another randomly named
folder.

You may be able to identify the installation (for curiosity) by
looking at some of the folder contents and decide if that installation
was okay, just delete the files/folders. If the installation did not
work properly for some reason, running the installation again will
just create a new randomly named temporary folder so the old temporary
folder is really of no use.

Sometimes the folders are stubborn to delete. Even if you are an
Administrator on the system you may get a "sharing violation", "access
denied", "being used" or similar type message when trying to remove
the temporary folders. Installations sometimes use different
permissions than a regular user with Administrator group might have.

There are many methods to try to remove the folders and some involve
third party programs to install or changing certain Windows settings
that may compromise your system security if you don't change them back
when you are done.

Booting your system in Safe Mode (pressing the F8 key repeatedly right
before XP tries to load) is a good method to use to try and and remove
the folders since it doesn't involve making any changes to your system
configuration or downloading any third party programs.

If Safe Mode does not work you can change the security of the folder
when booting in Normal Mode to give your user Full Control over the
folders by browsing to it in Explorer, click Tools, Folder Options,
View and in the Advanced settings window, uncheck (at the very bottom
of the list) Use simple file sharing (Recommended), and click OK.
This turns off the recommended simple file sharing on your computer so
you will want to turn it back on when you are finished doing whatever
you are doing.

Right click the folder(s) of interest, Properties and click the now
visible Security tab. Alter the Properties however you need to (for
example, Select your user name and check the box to allow Full
Control), click OK to apply the changes.

With the Use simple file sharing enabled (Recommended) box checked the
folder Properties tabs a

General, Sharing, Customize

With the Use simple file sharing disabled (Recommended) box UNchecked,
the folder Properties tabs a

General, Security, Customize

Now try to manipulate/delete the folder.

The method for XP Home is a little different.

It is a good idea to go back into Explorer any other settings you
changed and put the check back in the box for Use simple file sharing
(Recommended) when you have finished doing whatever you are doing.

If none of the above work, try a popular third party tool called
Unlocker.

Unlocker can be download from he

http://ccollomb.free.fr/unlocker/

Unlocker can be uninstalled when you are finished using it.

Reboot when you are finished to be sure the annoying folders are
really gone.
  #7  
Old November 22nd 10, 12:54 PM posted to microsoft.public.windowsxp.general
John John - MVP[_2_]
external usenet poster
 
Posts: 1,637
Default Creation of files that can't be deleted

On 11/21/2010 9:31 PM, Tester wrote:


Nil wrote:
On 21 Nov 2010, Tester wrote in
microsoft.public.windowsxp.general:

That is not accurate. Windows' file system is quite capable of
carrying a file with a name that Explorer can't deal with, especially
if the file name contains illegal characters or if the path is too long.



No it is not true. One can always delete any files or folders using
Windows Explorer *if one knows what one is doing* and one has the
Administrator rights if one is required.


No, that is false! A simple example is that of the MaxPath length of
260 characters, Windows Explorer cannot deal with these files. Another
example is that of reserved filenames which Windows Explorer cannot deal
with. You might be able to deal with these files at a command prompt or
with other utilities but Windows Explorer cannot deal with these files.

John

  #8  
Old November 22nd 10, 06:12 PM posted to microsoft.public.windowsxp.general
Paul
external usenet poster
 
Posts: 18,275
Default Creation of files that can't be deleted

John John - MVP wrote:
On 11/21/2010 9:31 PM, Tester wrote:


Nil wrote:
On 21 Nov 2010, Tester wrote in
microsoft.public.windowsxp.general:

That is not accurate. Windows' file system is quite capable of
carrying a file with a name that Explorer can't deal with, especially
if the file name contains illegal characters or if the path is too long.



No it is not true. One can always delete any files or folders using
Windows Explorer *if one knows what one is doing* and one has the
Administrator rights if one is required.


No, that is false! A simple example is that of the MaxPath length of
260 characters, Windows Explorer cannot deal with these files. Another
example is that of reserved filenames which Windows Explorer cannot deal
with. You might be able to deal with these files at a command prompt or
with other utilities but Windows Explorer cannot deal with these files.

John



And you can test this for yourself. You'll need a separate program,
to create long files. I used a short PERL script and ActiveState PERL
to do it. (That was simpler than setting up DJGPP again and doing
it in C.) This was tested in Win2K, inside a virtual machine.
File system is NTFS.

My test results were like this.

Length My program Explorer
can create can delete

X-1 Yes Yes
X Yes No
X+1 No ---

So there is exactly one file name length, that Explorer fails at.
The file system (NTFS) can handle one more character in this
case, than Explorer can handle. Those were my test results.

To get rid of that file, I just added a line to my PERL program,
to rename() the file, and by doing that, I could shorten the file
name length enough, so Explorer could delete it. (I could probably
have deleted it in PERL, but where is the fun in that.)

******* PERL test script, change bits as needed... *******
******* Install ActiveState ActivePerl free version before running *******

printf("this is a test\n");

# Make a long file name using concatenation.

$a = "0123456789";
$b = $a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a .$a.$a.$a.$a.$a.$a ;

$b = $b . "0123456.txt" ;

# Open in append mode, to support repeated test runs
# Program will die, if the file system denies creation because it's too long

open(OUT, "$b") || die("Cannot create file");
close(OUT);

use Cwd;
$c = getcwd ;

printf("%s/%s\n", $c , $b );

$c = $c . "/" . $b ;

printf("Length of full file path is %d\n", length $c );

# Uncomment this line, so the program will shorten the file name, before exit.

#rename( $b , $a );

exit(0);
******* End of script *******

You run the PERL script in a command prompt window, so you
can see the printout, like "this is a test".

In the problematic file name length test case, my program reports:

"this is a test

C:/downloads/perl/01234567890123456789012345678901234567890123456789 01234567890123456789012345678901234567890123456789 01234567890123456789012345678901234567890123456789 01234567890123456789012345678901234567890123456789 0123456789012345678901234567890123456.txt

Length of full file path is 259"

If I go to explorer and try to delete the file, the message is

"Error Deleting File or Folder
Cannot delete file. The filename you specified is invalid or too long.
Specify a different file name."

By uncommenting the rename() line near the end of the script, and
running the script again, the problematic file is no longer a
problem.

The script has to be adjusted slightly, depending on where in the
file system you create the file. I didn't want to create it
at the root level of the file system, for safety reasons.

Depending on how deep the path part is, when making the file,
will determine how long to make the file name part. I was
working in "C:/downloads/perl" while testing.

HTH,
Paul
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 02:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.