How to rename a directory with wildcards in cmd
batch-file, cmd, directory, windows
Solution
`rename` with wildcards only works on files, to rename a directory, use `move`;
C:\Temp>echo "test" > olle12
C:\Temp>mkdir olle13
C:\Temp>rename "*12" 12
C:\Temp>rename "*13" 13
The syntax of the command is incorrect.
C:\Temp>move "*13" 13
C:\Temp\olle13
1 dir(s) moved.
C:\Temp>dir
Directory of C:\Temp
2013-04-03 10:01 9 12
2013-04-03 10:01 <DIR> 13
Problem
I'm trying the following: ``` rename "*12" "12" ``` I get the error The syntax of the command is incorrect. What am I doing wrong and how can I achieve this? Is it that we cannot use wildcard characters in quotes? if yes how do i use them with quotes?