Need a script to automatically save pdf instead of displaying in IE.

Posted on 2006-04-08
Last Modified: 2008-02-01
I need this script because I have to save hundreds of pdf's from the web.  What makes it even more time consuming is a lot have the same name just in a different directory.  It doesn't seem to complicated, but I do not know windows.  So here is what I need: When IE tries to load a pdf, instead of associating it with acrobat, I want it to send to a batch file that will automatically save it to a directory.  In addition I want the name of the pdf to include the last directory name, for example: ../project1/1.pdf to be saved as project1 - 1.pdf.
Question by:CptanPanic
    LVL 69

    Expert Comment

    Hi CptanPanic  I donot have a clue how to do this my curiosity got the better of me just wanted to ask why 100's of PDF off web pages./ from the WEB pages??
    Why 100"s??  What are you doing?


    Author Comment

    I need to download all the service pdf's for a vehicle, to make a single pdf locally.
    LVL 63

    Expert Comment

    LVL 11

    Accepted Solution

    Hi CptanPanic,

    Look at URL2file.exe here:

    If you know the directory and filenames, you can then build a pair of batch files which will save files directly from the web to your harddrive in windows.  The batch file could look like this:

    :: GetList.BAT - get list of files
    CD "\My Documents\MyProject\Vehicle1"
    CALL getFile dir1 file1.pdf
    CALL getFile dir2 file1.pdf
    CALL getFile dir2 file2.pdf
    CALL getFile dir3 file1.pdf
    :: end of GetList.BAT

    :: getFile.BAT - use URL2file.exe to get files from web to similar dir on harddrive
    URL2file "" %1\%2
    :: end of GetFile.BAT

    Note the forward slash and backslash directory delimiters (web vs. Windows).  That's why we used two command-line parameters for dir and file separately.

    Peace and joy.  mvan
    LVL 11

    Expert Comment

    Sorry, to follow your example exactly, your getFile.BAT would be:

    URL2file "" "%1 - %2"

    I guess that's another reason to separate the last dir and the filename as individual parameters.  :-)  You can make your GetList.BAT file as long as you wish (as many files as you have the patience to download at one time).

    Peace and joy.  mvan
    LVL 11

    Expert Comment

    I know that my solution for CptanPanic works.  I use it weekly.  Peace and joy.  mvan

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    I wanted to pass this along in case anyone has a problem removing a device from the Device Manager, or if you suspect a corrupted Driver that you want to remove in its entirety. I know it is kinda lengthy and very basic in its format, but I figured …
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now