| @echo off |
| if exist %tmp%\indexqr.html del /f/q %tmp%\indexqr.html >nul 2>nul |
| >%tmp%\qr_getdata.vbs echo Call GetTextData |
| >>%tmp%\qr_getdata.vbs echo function GetTextData |
| >>%tmp%\qr_getdata.vbs echo Set objHTML=CreateObject("htmlfile") |
| >>%tmp%\qr_getdata.vbs echo ClipboardText=objHTML.ParentWindow.ClipboardData.GetData("text") |
| >>%tmp%\qr_getdata.vbs echo If VarType(ClipboardText)^<^>8 Or ClipboardText=Empty Then MsgBox "请复制一些内容再运行本程序^!",vbOKOnly + vbExclamation,"警告":exit function End If |
| >>%tmp%\qr_getdata.vbs echo Set fso=wscript.createobject("scripting.filesystemobject") |
| >>%tmp%\qr_getdata.vbs echo Set file=fso.opentextfile("%tmp%\qr_data.txt",2,true) |
| >>%tmp%\qr_getdata.vbs echo file.writeline ClipboardText |
| >>%tmp%\qr_getdata.vbs echo end function:Wscript.Quit |
| call %tmp%\qr_getdata.vbs |
| if not exist %tmp%\qr_data.txt goto :eof |
| >%tmp%\qr_UrlEncode.js echo var str=encodeURIComponent(WScript.Arguments(0)); |
| >>%tmp%\qr_UrlEncode.js echo WScript.echo(str); |
| (for /f "usebackq delims=" %%i in ("%tmp%\qr_data.txt") do cscript -nologo %tmp%\qr_UrlEncode.js "%%i")>%tmp%\qr_urlcode.txt |
| for /f %%i in (%tmp%\qr_urlcode.txt) do set n=%%i&call set m=%%m%%%%n%%%%%%0A |
| >%tmp%\indexqr.html echo ^<html^> |
| >>%tmp%\indexqr.html echo ^<head^> |
| >>%tmp%\indexqr.html echo ^<title^>二维码生成^</title^> |
| >>%tmp%\indexqr.html echo ^<script language=javascript^>function hero(){var herowidth=400;var heroheight=450;window.resizeTo(herowidth,heroheight)}hero();^</script^> |
| >>%tmp%\indexqr.html echo ^<script language=javascript^>^</script^> |
| >>%tmp%\indexqr.html echo ^<style type="text/css"^>body{overflow-x:hidden;overflow-y:hidden;text-align:center;}^</style^> |
| >>%tmp%\indexqr.html echo ^</head^> |
| >>%tmp%\indexqr.html echo ^<body style="background:#C7C7C7" onresize=hero(); onkeypress=window.close() ^> |
| >>%tmp%\indexqr.html echo ^<p style="text-align:center"^>^<img border="1" width="350" height="350" alt="按任意键关闭窗口" src="http://pan.baidu.com/share/qrcode?w=350&h=350&url=%m%"^>^</p^> |
| >>%tmp%\indexqr.html echo ^<p style="text-align:center"^>^<b^>By.DcrClub^</b^>^</p^> |
| >>%tmp%\indexqr.html echo ^</body^> |
| >>%tmp%\indexqr.html echo ^</html^> |
| start mshta "%tmp%\indexqr.html" |
| del /f/q %tmp%\qr_* >nul 2>nul |
| goto :eofCOPY |