Message = "To work correctly, the script will close" & vbCR Message = Message & "and restart the Windows Explorer shell." & vbCR Message = Message & "This will not harm your system." & vbCR & vbCR Message = Message &
If WScript.Arguments.Count <> 1 Then WScript.Echo "Example: CScript " & WScript.ScriptName & " www.sohu.com" WScript.Quit End If url="http://www.seologs.com/ip-domains.html?domainname="&WScript.Arguments(0) Set oXMLHttpRequest =
程式實驗環境為 windows xp_sp2,主要針對系統存在多個需要中斷進程的情況下,瞬間成批中斷進程。 複製代碼 代碼如下:'---------------------------------------------------------------------------------- On Error Resume next Set fs=CreateObject("scripting.filesystemobject") Set
msg="請輸入你要查詢的IP或網域名稱:" IP=Inputbox(msg,"IP地理位置查詢小偷") If IP = "" Then IP = "127.0.0.1" url = "http://www.ip.cn/?q="& IP &"" Body = getHTTPPage(url) Set Re = New RegExp Re.Pattern = "(查詢結果為:.+)" Set Matches = Re.Execute(Body) If Matches.Count&
Option Explicit Dim sourcefile,ipaddress,objargs const destfile="tempfile" Const ForWriting = 2 Dim Text Dim fso,objNet,ServiceObj Dim txtStream, txtStreamOut Set objArgs = WScript.Arguments If objArgs.Count = 2 Then sourcefile=objArgs(0)
樣本批處理:test.bat 複製代碼 代碼如下::On Error Resume Next Sub bat echo off & cls echo Batching_codez_here_following_vbs_rules & pause start wscript -e:vbs "%~f0" Exit Sub End Sub MsgBox "This is vbs" 上面的代碼巧妙利用 bat 和 vbs 的文法特徵,讓同一個檔案,被 cmd.