#1
There are multiple folders. There are many files in them and I want to make the names of these files the same as the folder name.

I've looked at similar questions; but none of them contained an answer for the result I wanted.

I would like to explain what I want as an example.

SAMPLE:

Folder Names
  • Christmas Lights
  • life in natural
  • Botanical
  • Pinky-Dreams-World

File Names in a Folder

Christmas Lights
45646.(extension)
ldsa4da56.(extension)

Life in Natural
1t24da.(extension)

Botanical
d46asda.(extension)

Pinky-Dreams-World
42042kd.(extension)

What I want is to replace the name of each file with the name of the folder it is in. But do not change the extensions when changing.

The result I want:

Pinky Dreams
Pinky Dreams.(extension)

Botanical
Botanical.(extension)

How can I do this with CMD, Powershell or a Macro?