locked
Saving web page in IE with a batch file RRS feed

  • Question

  • I am trying to write a batch file that opens a series of web pages and saves them to .htm or .mht format. I am also going to need to schedule it to run Monday-Friday. I have so far been unable to find a reference of IE CMD options. Any suggestions?
    Monday, July 27, 2015 3:38 PM

Answers

  • If you want to do it via a batchscript then the only way I can think of would be to download wget (http://gnuwin32.sourceforge.net/packages/wget.htm) and then call that from within your batchscript for each page you want to retrieve. Eg, you call "wget www.mydomain.com/webpage.htm" and it will retrieve that webpage to the current working directory. There's a lot of options available within wget depending on what you're trying to do, see http://www.gnu.org/software/wget/manual/wget.html for the complete syntax.

    Alternatively, if you wanted to stay natively within Windows but weren't bothered about it being done via batch you could try doing it using PowerShell and the Invoke-WebRequest cmdlet (note, requires Powershell v3), for instance "Invoke-WebRequest http://www.mydomain.com/webpage.htm -OutFile savedpage.htm"

    If you need help with the specifics of how you'd write the script then I'd suggest posting in the scripting forum https://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG

    Monday, July 27, 2015 7:59 PM