Computing Staff
  • 2

Rename A Folder With Unknown Name Via Cmd

  • 2

hello.
How can I rename a directory with unknown name (without knowing folder’s name) through CMD in windows (7) ?
Or rename all subfolders of a folder or rename a folder that we know just a part of its name like “hello” at the last of folder’s name?
thanx.

Share

4 Answers

  1. Thanks for your answer.
    I found answer :
    when we don’t know the directory name we can rename it with command “for” like below :

    for /d %a in (“C:\folderpath\*”) do rename
    %a newname
    and we can do more things with “for” command.

    THUND3R.

    • 0
  2. You have dots in the folder names. You could try…
    ren “*test” “newname.test”

    I am not sure this will work thought.

    • 0
  3. What is the command you used?

    If you know the last part of the file then you put the star in front like…

    ren *oldfolder *newfolder

    but if you give us more like the name of the folder you are trying to change.

    http://www.robvanderwoude.com/allhe…

    • 0
  4. The computer can not read your mind. You have to know what you want to rename even if it is a part of the name or even something that is in the folder. Other wise you have to ask the user a question as to the name.
    Can you provide one of these like a partial name…

    ren New* Old*

    The * means any folders that start with the name new so like NewFolder will be renamed OldFolder and so on.

    Or if there is a file that will exist in the folder that we can find. Something.

    • 0