I have scripted GetSource.bat to retrieve the source of a Web page and write it to a file.

This script can also be used if the right-clicking has been disabled, or if viewing source has been prevented.

The syntax for using GetSource.bat is:

GetSource URL FileName

Where:

<b>URL</b>      is the Web page URL, like <a target='NewWindow"' href="HTTP://www.JSIINC.COM">HTTP://www.JSIINC.COM</a> or HTTP://www.JSIFAQ.com/SUBT/TIP9800/RH9840.htm.

<b>FileName</b> is the file that will contain the <b>URL</b> source, like C:\Folder\FileName.htm or FileName.txt.
GetSource.bat contains:
@echo off
if \{%2\}==\{\} @echo Syntax GetSource URL FileName&goto :EOF
setlocal
if exist "%TEMP%\GetSource.vbs" goto getit
@echo.dim fso, writefile, contents, Filename, objArguments, url>"%TEMP%\GetSource.vbs"
@echo.set fso = CreateObject("Scripting.FileSystemObject") >>"%TEMP%\GetSource.vbs"
@echo.Set objArguments = Wscript.Arguments>>"%TEMP%\GetSource.vbs"
@echo.url=objArguments(0) >>"%TEMP%\GetSource.vbs"
@echo.Filename=objArguments(1) >>"%TEMP%\GetSource.vbs"
@echo.set xmlhttp=createobject("microsoft.xmlhttp") >>"%TEMP%\GetSource.vbs"
@echo.xmlhttp.open "GET", url, False>>"%TEMP%\GetSource.vbs"
@echo.xmlhttp.send>>"%TEMP%\GetSource.vbs"
@echo.contents=xmlhttp.responsetext>>"%TEMP%\GetSource.vbs"
@echo.set writefile = fso.CreateTextFile(FileName, 2) >>"%TEMP%\GetSource.vbs"
@echo.writefile.writeLine contents>>"%TEMP%\GetSource.vbs"
@echo.writefile.close>>"%TEMP%\GetSource.vbs"
:getit
cscript //nologo "%TEMP%\GetSource.vbs" %1 %2