Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename a directory with wildcards in cmd

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?

like image 824
Shalzz Avatar asked Dec 11 '22 16:12

Shalzz


1 Answers

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
like image 195
Joachim Isaksson Avatar answered Dec 25 '22 10:12

Joachim Isaksson