yarek
yarek

Reputation: 12034

How to remove prefixes into files using the Windows command line

My files are x_name.png, x_something.png, x_somethingElse.png

How can I remove the "x_" prefix from all these files ?

Upvotes: 0

Views: 66

Answers (1)

Scott C
Scott C

Reputation: 1660

I don't think you can do this with a single line, you'll need a basic batch file.

@echo off
setlocal enabledelayedexpansion
for %%a in (x_*.*) do (
    set fname=%%a
    set fname=!fname:~2!
    ren "%%a" "!fname!"
)

Upvotes: 1

Related Questions