Book Titles and How Windows hates colons - A Script to Change File Name?


I am a newbie so please forgive any fumbles.

This is a general, “Is it possible?” question. If so, I just need the broad contours and then I will get to work studying / scripting.

I download many ebooks. Books often have a main title, then a subtitle separated by a colon.
Windows rejects colons in file names. So, I am always fixing the filename that pops up in the save as dialog box. I would like to run a script that takes the filename that shows up in the Save As dialog box, and “cleans it” with my formatting parameters, deletes the “downloaded” filename out of the Save As box and replaces it with my “cleaned up” file name. And then I can save to my book directory and be done quickly.

A minor irritation for one or two books, but a pain when you do research. Thanks in advance for any and all ideas.

Sounds like the save as dialog is part of the browser. It’s not a trivial task to hook into another process, but is technically possible. A much simpler solution would be using invoke-webrequest with the full url to the download at which point you can save the raw content with whatever file type you like.

1 Like