N
N
Nikita Nafranets2015-11-28 03:15:27
cmd/bat
Nikita Nafranets, 2015-11-28 03:15:27

How to rename files in a folder under the folder name?

Let's say there is a folder called 0001, it contains files called 1414.* 1553.* 5616.* 1122.* how to rename all these files to match the folder name? So that everyone becomes 0001-1.* 0001-2.*, etc.?
There are as many folders as there are files in these folders. I know about F2, I would not want to bypass each folder. Thanks in advance.
Upd. Found an answer to your question. I found the novA FileRenamer program, it supports this feature. Thanks to all.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita Nafranets, 2015-11-28
@Dimensi

I found the novA FileRenamer program , it supports this feature.

A
Artem @Jump, 2015-11-28
curated by the

The easiest option is to select all the files in the folder, press the "F2" key and enter a new name. But here you can not choose a template.
If the template matters - we write the simplest batch file or script that will bypass all files and rename them according to the template.

@echo off
setlocal

for %%i in (*.txt) do call:rename "%%i"
goto:eof

:rename
set /a cnt+=1
set "post=00%cnt%"
ren %1 "0001-%post:~-3%.txt"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question