CMD Rename

To rename all files and subfolders within a directory from the command line you'll need to go to the folder location 

  1. Press Win+R and type CMD
  2. Navigate to the directory you wish to rename the files/folders within
  3. List the contents of the directory by typing:
    • Dir /W

once there use the following command line where "xPrefix" is the naming prefix:

  • FOR /F "tokens=*" %a in ('dir /b') do REN "%a" "xPrefix %a"
This will rename all the files/folders within the directory with the prefix of "xPrefix "
I.e.
  • xPrefix filename.xxx
  • xPrefix foldername
NB: This will only rename the files and folders at  level the command line is executed from not subfolders/files

Comments

Popular posts from this blog

Stay COVID Meeting Safe

Cyber Security Awareness 002: Understanding PII (Personally Identifiable Information)

Filling the G-Apps: RIP Google Legacy