I have a simple batch file with which I want to use the wkhtmltopdf to create PDF files of an archived set of URLs.
The simple command of my batch file for wkhtmltopdf is as follows
start
cd C:\Program Files\wkhtmltopdf\bin
start wkhtmltopdf.exe https://web.archive.org/web/20200524/website.org/article-may-2020-title"C:/Desktop/pdfs/file1.pdf"
pause
This works as expected in a Windows 10 env. as it generates the single PDF file in above location, but the filename is how you set it.
What I want to achieve is to get the article slug from the URL after and make it so the PDF that is generated locally will have the same filename as the article slug;
I.e. from the URL above, take the part (which is after .....website[.]org/) article-may-2020-title and then the locally saved file would be autogenerated or filled into the batch file as "C:/Desktop/pdfs/article-may-2020-title.pdf"
Can this be done with a batch file? Is this easier to be done with a powershell script. If so any hints are appreciated.
Thanks.