Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Rename the pdf file inside sub-directories to the name of the sub directory

$
0
0

I am using win 7 platform. Need your help to create a bat file which simplifies my job. My folders and files are arranged in this structure.

File1

  • folder1 ->abcd.pdf
  • folder2 ->shhd.pdf.............................. folderN ->gfdfgd.pdf

File2

  • folder1 ->gbg.pdf
  • folder2 ->kjc67z.pdf.............................. folderN ->iuxz4i.pdf

--

--

--

FileN

  • folder1 ->ah455.pdf
  • folder2 ->jfhd45.pdf.............................. folderN ->juvxzr.pdf

I want to generate a batch file which renames the pdf file to name of the folder it contains. For example, in the above structure "abcd.pdf" is renamed to folder1.pdf.Respectively this is done for all pdf files.

Also a folder named "test" is created inside each directory(file1,file2..etc) which contains all the renamed pdf files of its respective directory.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>