renaming a directory thru DOS on winxp

L

liz

I am trying to rename a directory on my c:\ thru dos
commands (i am creating a batch file)

Microsoft recommends the "move command"

if I move a directory at the root of c:\ it works,
however if the directory is lengthly like the following I
get an error. Can anyone shed some light on this;

I want to rename or move the common framework directory
from the path below, to the same directoy only rename the
directory commframold

c:\program files\network associates\common framework
 
J

John Coode

liz said:
I am trying to rename a directory on my c:\ thru dos
commands (i am creating a batch file)

Microsoft recommends the "move command"

if I move a directory at the root of c:\ it works,
however if the directory is lengthly like the following I
get an error. Can anyone shed some light on this;

I want to rename or move the common framework directory
from the path below, to the same directoy only rename the
directory commframold

c:\program files\network associates\common framework

Did you try putting quotes round the path? Like
"c:\program files\network associates\common framework"
The spaces in program files and network associates cause problems.
 
R

R. C. White

Hi, Liz.

Your problem may be with the spaces in your pathname, rather than with the
Move command. To handle LFNs (Long File Names) in either MS-DOS or in the
DOS emulator, also called the Command Prompt, in WinXP, you must enclose the
entire pathname in quotes. Even short filenames are considered LFNs if
there is a space anywhere in the pathname or filename. Also, you must
include the new path, if different from the original.

Try this:
move "c:\program files\network associates\common framework" commframold

to simply rename it in the same place, or:
move "c:\program files\network associates\common framework" c:\commframold

to move it to C:\ and rename it there.

Different rules apply when moving a file from one volume to another, as
opposed to moving from folder to folder within a single volume. To move to
a different volume, the entire file must actually be copied to the new
location, then deleted from the old. To move within a volume, all that must
be done is to create the directory entry in the new folder, then delete it
from the old; the file/folder contents remain where they were.

In the "DOS" window, type any command followed by /? to see a mini-Help file
listing the switches available with that command: Move /?, or Ren /?

RC
 
L

Len Dolby

You are stuck with the DOS naming constraint - directory name can only be 8
characters if created in DOS.

Create the directory in Windows. Use Explorer (or Search) to the penultimate
directory, open it, then "New" (name of your choice). You now have a path
recognisable in DOS (it will have tilde at name end, truncating it to 8
characters) Then, batch away !
Hope this helps LEN
 
L

liz

You are awesome!!! Thank you - the dange" "

You wouldn't know the command for deleting a directory
would you?
 
L

liz

You are awesome!!! Thank you - the dange" "

You wouldn't know the command for deleting a directory
would you?
 
L

liz

You are awesome!!! Thank you - the dange" "

You wouldn't know the command for deleting a directory
would you?
 
K

Ken Blake, MVP

In
liz said:
You are awesome!!! Thank you - the dange" "

You wouldn't know the command for deleting a directory
would you?

rd


--
Ken Blake - Microsoft MVP Windows: Shell/User
Please reply to the newsgroup


 
R

R. C. White

Hi, Liz.

Sure. It's Remove Directory, rd for short. Add the /s switch and it will
wipe out the entire directory in one fell swoop, files, subdirectories and
all. rd <filename> /s

RC
 

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

Similar Threads


Top