General discussion

Locked

rename directory

By Jinesh ·
I would like to know a command that I can use in a batch file to rename a folder in NT. I already tried 'ren' and 'rename' and it does not work

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

rename directory

by DKlippert In reply to rename directory

Let's see how this formaiting works. The DOS command is MOVE. In VB it would be C:\OldName as C:\NewName.

To move one or more files:
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination

************* To rename a directory:

MOVE [/Y | /-Y] [drive:][path]dirname1 dirname2

[drive:][path]filename1 Specifies the location and name of the file or files you want to move.

destination Specifies the new location of the file.Destination can consist of a drive letter and colon, a directory name, or a combination.If you are moving only one file, you can also include a filename if you want to rename the file when you move it.
[drive:][path]dirname1 Specifies the directory you want to rename.
dirname2 Specifies the new name of the directory.

/Y Suppresses prompting to confirm creation of a directory or overwriting of the destination.
/-Y Causes prompting to confirm creation of a directory or overwriting of the destination.

The switch /Y may be presentin the COPYCMD environment variable.
This may be overridden with /-Y on the command line.

Collapse -

rename directory

by Jinesh In reply to rename directory

Poster rated this answer

Collapse -

rename directory

by Jinesh In reply to rename directory

This question was closed by the author

Back to Windows Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums