根据网上的资料,目前我使用run.vbs打开了getadmin.bat,getadmin获取了管理员权限再打开run.bat。但这个脚本在运行的时候还是无法隐藏run.bat的黑框,只能隐藏getadmin.bat的黑框
cwd = CreateObject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path
# 引号里面 换成自己的bat文件名称
path = cwd & "\RestartInternet.bat"
Set shell = CreateObject("Shell.Application")
# 0 表示 后台运行 1表示 正常运行
# 0 不会显示cmd窗口, 1表示正常显示cmd窗口
shell.ShellExecute path,"","","runas",0
WScript.Quit
这样就可以隐藏cmd运行窗口并且还是管理员运行
简单直接,把bat转成exe