|
本帖最后由 窄口牛 于 2020-2-13 17:29 编辑
- On Error Resume Next
- strURL = "http://192.168.2.1/o"
- Set objHTTP = CreateObject("MSXML2.XMLHTTP")
- objHTTP.Open "GET", strURL, FALSE
- objHTTP.Send
- 'msgBox objHTTP.Status
- 'msgbox objHTTP.StatusText
- 'Wscript.Echo(objHTTP.statusText)
- if objHTTP.StatusText="OK" then
- msgBox "去你的"
- else
- msgBox "你去的"
- end if
复制代码 搞通这个了,思路已有,今天出结果。生成所有可能地址的vbs,同时运行,不通的就删除自己(vbs),通的就直接完成建立快捷方式。
成品来了,不是通用需求就不打下载包了。
- @echo on
- Setlocal enabledelayedexpansion
- reg query HKU\S-1-5-20>nul || echo;CreateObject^("Shell.Application"^).ShellExecute "%~f0", "%*", "", "runas", 1 > "%temp%\getadmin.vbs" && cscript //b "%temp%\getadmin.vbs" && exit /b & del "%temp%\getadmin.vbs" /f /q>nul 2>nul
- pushd "%CD%"&& CD /D "%~dp0"
- for /f "tokens=1,2 delims=:" %%a in ('ipconfig /all^|find "默认网关"') do (
- for /f "tokens=1,2,3,4 delims=." %%a in ("%%b") do (
- call,set Segment=%%a.%%b.%%c
- call,set Segment=%%Segment: =%%
- )
- )
- for /f "skip=2 tokens=1,2*" %%a in ('reg query HKCU\Software\HCChrome /v install_path') do (
- set extPath=%%c
- )
- set Program="%extPath%\Chrome.exe"
- set WorkDir="%extPath%"
- for /l %%a in (211,1,216) do (
- set "purpose=/xxzl"
- set "LnkName=学习资料观看系统"
- set a=%%a
- call, :creat !a!
- set "purpose=/ywcz"
- set "LnkName=业务操作系统"
- set a=%%a
- call, :creat !a!
- set "purpose=:8080/rygl"
- set "LnkName=人员管理系统"
- set a=%%a
- call, :creat !a!
- )
- for /f %%a in ('dir *.vbs /a-d /b') do start "" %%a
- :creat
- (echo On Error Resume Next
- echo strURL = "http://%Segment%.!a!%purpose%"
- echo Set objHTTP = CreateObject("MSXML2.XMLHTTP"^)
- echo objHTTP.Open "GET", strURL, FALSE
- echo objHTTP.Send
- echo if objHTTP.StatusText="OK" then
- echo Set WshShell=CreateObject("WScript.Shell"^)
- echo strDesKtop=WshShell.SpecialFolders("DesKtop"^)
- echo Set oShellLink=WshShell.CreateShortcut(strDesKtop^&"\%LnkName%.lnk"^)
- echo oShellLink.TargetPath=%Program%
- echo oShellLink.Arguments="http://%Segment%.!a!%purpose% --allow-outdated-plugins"
- echo oShellLink.WorkingDirectory=%WorkDir%
- echo oShellLink.WindowStyle=1
- echo oShellLink.Description="%LnkName%"
- echo oShellLink.Save
- echo Set fso = CreateObject("Scripting.FileSystemObject"^)
- echo f = fso.DeleteFile(WScript.ScriptName^)
- echo else
- echo Set fso = CreateObject("Scripting.FileSystemObject"^)
- echo f = fso.DeleteFile(WScript.ScriptName^)
- echo end if)>%LnkName%!a!.vbs
复制代码
|
|