Is there a simple way to rename a file to the the same as the folder it is in?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
SuperDerpBro
Posts: 12
Joined: 09 Jan 2016 21:01

Is there a simple way to rename a file to the the same as the folder it is in?

#1 Post by SuperDerpBro » 11 Jan 2016 00:56

The parent folder of the currently running batch file.

EDIT: If i add for %%a in ("%cd%") do ren "*.mkv" "%%~Na.mkv" to my .bat.. when it gets to that step it makes a file with only about halfthefoldername.mkv

EDIT: Got it working with
for %%a in ("%cd%") do ren "*.mkv" "%%~NXa.mkv"



Post Reply