Can't Rename a File Using WinXP Command Prompt!!!

J

John Burke

SITUATION: I have a file in WinXP whose name is too long. It cannot
be opened. It needs to be given a shorter name so that it can be
opened.

PROBLEM: I cannot rename it using the Command Prompt and the
appropriate DOS command >> REN <<

PARTICULARS:

1. I've changed the directory to the appropriate sub-directory

2. I've used the DIR command to list the files in this sub-directory.
The file I'm looking for _was_ listed therein.

3. I've _repeatedly_ used the REN command

REN OldFileName.* NewFileName.*

I've typed in the OldFileName.* _exactly_ as it was listed in the
results of the DIR command. _Every_ time I've done so, I get a >> The
syntax of the command is incorrect << error message.

4. I've used the >> DIR OldFileName << Command to see if the specific
file I'm trying to rename would be recognized. It was _not_ -- I get
a >> File not found << error message (Even though, as noted in Item 2
above, the DIR command for the sub-directory in which it was located
_does_ list it!).

5. The old filename in question contains the following symbols as part
of its name:

[PartofFileName] - Opening and closing brackets

''PartofFileName'' - Two single stroke quotation marks repeated before
and after portions of the file name text (to simulated quotation marks
that WinXP filenames will not allow

-- PartofFileName -- - Double Dashes that seperate portions of the
file name text

6. The type of file I'm trying to rename is an askSam file >> *.ask
<<. I'm trying to open it with askSam version 6.1.

7. I've done this before. This is the first time I've been unable to
rename a too-long filename using this method.

QUESTION: How do I rename (shorten) this filename so I can open it?

Thanks.

2privatus
 
S

Shenan Stanley

John said:
SITUATION: I have a file in WinXP whose name is too long. It cannot
be opened. It needs to be given a shorter name so that it can be
opened.

PROBLEM: I cannot rename it using the Command Prompt and the
appropriate DOS command >> REN <<

PARTICULARS:

1. I've changed the directory to the appropriate sub-directory

2. I've used the DIR command to list the files in this
sub-directory. The file I'm looking for _was_ listed therein.

3. I've _repeatedly_ used the REN command

REN OldFileName.* NewFileName.*

I've typed in the OldFileName.* _exactly_ as it was listed in the
results of the DIR command. _Every_ time I've done so, I get a >>
The syntax of the command is incorrect << error message.

4. I've used the >> DIR OldFileName << Command to see if the
specific file I'm trying to rename would be recognized. It was
_not_ -- I get a >> File not found << error message (Even though,
as noted in Item 2 above, the DIR command for the sub-directory in
which it was located _does_ list it!).

5. The old filename in question contains the following symbols as
part of its name:

[PartofFileName] - Opening and closing brackets

''PartofFileName'' - Two single stroke quotation marks repeated
before and after portions of the file name text (to simulated
quotation marks that WinXP filenames will not allow

-- PartofFileName -- - Double Dashes that seperate portions of the
file name text

6. The type of file I'm trying to rename is an askSam file >> *.ask
<<. I'm trying to open it with askSam version 6.1.

7. I've done this before. This is the first time I've been unable
to rename a too-long filename using this method.

QUESTION: How do I rename (shorten) this filename so I can open it?

Sounds like the filename + directory path may be too long.
Use the SUBST command to associate the folder the file is located in with
its own drive letter and then change into that 'new drive' and rename
there...
 
M

M.I.5¾

John Burke said:
SITUATION: I have a file in WinXP whose name is too long. It cannot
be opened. It needs to be given a shorter name so that it can be
opened.

PROBLEM: I cannot rename it using the Command Prompt and the
appropriate DOS command >> REN <<

PARTICULARS:

1. I've changed the directory to the appropriate sub-directory

2. I've used the DIR command to list the files in this sub-directory.
The file I'm looking for _was_ listed therein.

3. I've _repeatedly_ used the REN command

REN OldFileName.* NewFileName.*

I've typed in the OldFileName.* _exactly_ as it was listed in the
results of the DIR command. _Every_ time I've done so, I get a >> The
syntax of the command is incorrect << error message.

4. I've used the >> DIR OldFileName << Command to see if the specific
file I'm trying to rename would be recognized. It was _not_ -- I get
a >> File not found << error message (Even though, as noted in Item 2
above, the DIR command for the sub-directory in which it was located
_does_ list it!).

5. The old filename in question contains the following symbols as part
of its name:

[PartofFileName] - Opening and closing brackets

''PartofFileName'' - Two single stroke quotation marks repeated before
and after portions of the file name text (to simulated quotation marks
that WinXP filenames will not allow

-- PartofFileName -- - Double Dashes that seperate portions of the
file name text

6. The type of file I'm trying to rename is an askSam file >> *.ask
<<. I'm trying to open it with askSam version 6.1.

7. I've done this before. This is the first time I've been unable to
rename a too-long filename using this method.

QUESTION: How do I rename (shorten) this filename so I can open it?

Try putting the filename in quotes. Like

REN "VeryLongOldTypeFileName.doc" "ShortName.doc"

This is the only way of doing it if the filename contains space characters.
If the filename is too long then it may exceed the command line max length.

Why can't you change the filename from Windows itself?
 
M

Mark L. Ferguson

Also, the command prompt will accept a wildcard ending on the long name.

ren oldfilen*.* new.*

--
Was this helpful? Then click the Ratings button. Voting helps the web
interface.
http://www.microsoft.com/wn3/locales/help/help_en-us.htm#RateAPostAsAnswer
Mark L. Ferguson
..

M.I.5¾ said:
John Burke said:
SITUATION: I have a file in WinXP whose name is too long. It cannot
be opened. It needs to be given a shorter name so that it can be
opened.

PROBLEM: I cannot rename it using the Command Prompt and the
appropriate DOS command >> REN <<

PARTICULARS:

1. I've changed the directory to the appropriate sub-directory

2. I've used the DIR command to list the files in this sub-directory.
The file I'm looking for _was_ listed therein.

3. I've _repeatedly_ used the REN command

REN OldFileName.* NewFileName.*

I've typed in the OldFileName.* _exactly_ as it was listed in the
results of the DIR command. _Every_ time I've done so, I get a >> The
syntax of the command is incorrect << error message.

4. I've used the >> DIR OldFileName << Command to see if the specific
file I'm trying to rename would be recognized. It was _not_ -- I get
a >> File not found << error message (Even though, as noted in Item 2
above, the DIR command for the sub-directory in which it was located
_does_ list it!).

5. The old filename in question contains the following symbols as part
of its name:

[PartofFileName] - Opening and closing brackets

''PartofFileName'' - Two single stroke quotation marks repeated before
and after portions of the file name text (to simulated quotation marks
that WinXP filenames will not allow

-- PartofFileName -- - Double Dashes that seperate portions of the
file name text

6. The type of file I'm trying to rename is an askSam file >> *.ask
<<. I'm trying to open it with askSam version 6.1.

7. I've done this before. This is the first time I've been unable to
rename a too-long filename using this method.

QUESTION: How do I rename (shorten) this filename so I can open it?

Try putting the filename in quotes. Like

REN "VeryLongOldTypeFileName.doc" "ShortName.doc"

This is the only way of doing it if the filename contains space
characters. If the filename is too long then it may exceed the command
line max length.

Why can't you change the filename from Windows itself?
 

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