N
N
Nikolai Ugolnikov2022-01-11 18:50:51
cmd/bat
Nikolai Ugolnikov, 2022-01-11 18:50:51

How to remove prefix from all files?

You need to remove the prefix from all files in the directory, for example [email protected]. How can I do that?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Tsvetkov, 2022-01-11
@Ugolnikovvv

RENAME "[email protected]*" "/////*"
remove the same part of a file name for many files

W
wisgest, 2022-01-11
@wisgest

If in a batch file, then you can

ren "[email protected]*" "     *"
for %%i in ("     *") do  for /f "tokens=*" %%j in ("%%i") do  ren "%%i" "%%j"

- the first command replaces the prefix with spaces (the number of spaces is equal to the length of the prefix, see https://qna.habr.com/q/1059906#answer_2036902 ), and the second one removes the spaces.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question