Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Software >> OS >> Windows >> Command Line >> For >> How to use FOR command to process each file matching a pattern and rename with a prefix

## Example we want to loop through all files matching p????.gif and add a prefix 2010-

for /F %%a in ('dir /b  p????.gif') do rename %a 2010-%%a

## For example to rename the folders Topic.nn to Topic.0nn


 

Note:

  • When running it via a batch file use %%a
  • When running directly on a command prompt use %a

 

[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]