renaming files

G

Guest

Have XP home installed for the first time and everytime i try to rename a
file i get the message "if you change a file name extesnion the file may
become unusable" I can rename them but they are saved as just a "file" and
when i open them again i must choose the program needed to open them manually
I have tried creating a new user and have tried both as an administrator and
limited user but either way the same things happen
Any suggestions?
 
M

Mundungus Fletcher

markus said:
Have XP home installed for the first time and everytime i try to rename a
file i get the message "if you change a file name extesnion the file may
become unusable" I can rename them but they are saved as just a "file" and
when i open them again i must choose the program needed to open them manually
I have tried creating a new user and have tried both as an administrator and
limited user but either way the same things happen

Sounds like the "file extension" is not being preserved when you rename
the file. In other words, when you rename a file, be aware of the "."
and the last 2-3 letters at the end of the name.

i.e. a MS Word document ends with ".doc" so if you wanted to change the
filename from "test.doc" to "markus" you should keep the .doc at the end
as in "markus.doc"

If this doesn't work, then there might be something else wrong.

Dung.
 
D

David Candy

Doesn't matter for Word files as they are OLE compound files. If a OLE compound file has a extension not registered (no extension isn't registered) the CLSID is read from the file and opened.

Windows uses

1. Extensions
2 .FileTypes key (a list of markers that explorer can recognise files from, eg you could tell it any file that starts with <html> is a web document (see HKEY_CLASSES_ROOT\FileType)).
3. The CLSID inside OLE compound files.


(Non-Compound) FileType Key
Used by GetClassFile to match patterns against various file bytes in a non-compound file.

Registry Entry
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\
\FileType
\<CLSID>
\<n> = <offset, cb, mask, value>

Value Entries
offset
This value determines how far from the beginning or end of the file to begin the comparison. If the offset is a negative value then the comparison will begin from the end of the file minus the offset value. The offset value is a decimal type unless preceded by "0x".
cb
Represents the length in bytes from the beginning to the end of the file. Represents the byte range in the file. The cb value is a decimal unless preceded by "0x".
mask
A binary value used for masking, which is performed by using a logical AND operation, and the byte range specified by offset and cb. If this value is omitted then the bytes will be set to all ones. This value is always hexadecimal.
value
Represents the pattern that must match for a file to be of this FileType. The pattern is used to properly identify a known file format from its contents not by its extension.
Remarks
Entries under the FileType key are used by the GetClassFile function to match patterns against various file bytes in a non-compound file. FileType has CLSID sub keys, each of which has a series of sub keys \0, \1, \2.. These values contain a pattern that, if matched, yield the indicated CLSID. Following are examples of FileType entries.
\0 = 0, 4, FFFFFFFF, ABCD1234
where the first 4 bytes must be ABCD1234, in that order, or
\1 = 0, 4, FFFFFFFF, 9876543
where they must match 9876543, or
\2 = -4, 4, FEFEFEFE
where the last four bytes in the file must be FEFEFEFE.

See Also
GetClassFile, File Extension
 
G

Guest

Thx Dung that fixed my problem

David Candy said:
Doesn't matter for Word files as they are OLE compound files. If a OLE compound file has a extension not registered (no extension isn't registered) the CLSID is read from the file and opened.

Windows uses

1. Extensions
2 .FileTypes key (a list of markers that explorer can recognise files from, eg you could tell it any file that starts with <html> is a web document (see HKEY_CLASSES_ROOT\FileType)).
3. The CLSID inside OLE compound files.


(Non-Compound) FileType Key
Used by GetClassFile to match patterns against various file bytes in a non-compound file.

Registry Entry
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\
\FileType
\<CLSID>
\<n> = <offset, cb, mask, value>

Value Entries
offset
This value determines how far from the beginning or end of the file to begin the comparison. If the offset is a negative value then the comparison will begin from the end of the file minus the offset value. The offset value is a decimal type unless preceded by "0x".
cb
Represents the length in bytes from the beginning to the end of the file. Represents the byte range in the file. The cb value is a decimal unless preceded by "0x".
mask
A binary value used for masking, which is performed by using a logical AND operation, and the byte range specified by offset and cb. If this value is omitted then the bytes will be set to all ones. This value is always hexadecimal.
value
Represents the pattern that must match for a file to be of this FileType. The pattern is used to properly identify a known file format from its contents not by its extension.
Remarks
Entries under the FileType key are used by the GetClassFile function to match patterns against various file bytes in a non-compound file. FileType has CLSID sub keys, each of which has a series of sub keys \0, \1, \2.. These values contain a pattern that, if matched, yield the indicated CLSID. Following are examples of FileType entries.
\0 = 0, 4, FFFFFFFF, ABCD1234
where the first 4 bytes must be ABCD1234, in that order, or
\1 = 0, 4, FFFFFFFF, 9876543
where they must match 9876543, or
\2 = -4, 4, FEFEFEFE
where the last four bytes in the file must be FEFEFEFE.

See Also
GetClassFile, File Extension
 
A

Alex Nichol

Mundungus said:
Sounds like the "file extension" is not being preserved when you rename
the file. In other words, when you rename a file, be aware of the "."
and the last 2-3 letters at the end of the name

And make sure that in Folder Options - View that 'hide extensions for
registered file types' is not checked, so that you can see what you are
doing and retain the same extension on the renamed file
 

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