Discussion Locked

rename directory

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
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

3 replies

by dklippert

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.

This discussion is closed to new replies.