主程序帮你改了下
子程序看不清- Set objWMIService = GetObject("Winmgmts:")
- Set colOperatingSystems = objWMIService.InstancesOf("Win32_OperatingSystem")
- For Each objOperatingSystem In colOperatingSystems
- name1 = objOperatingSystem.Caption
- Next
-
- If InStr(1, name1, "microsoft windows xp", 1) Then
- winxp()
- Else
- Set objShell = CreateObject("Shell.Application") 'Win7下提权
- objShell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & _
- Chr(34) & " uac", "", "runas", 1
- win7()
- End If
复制代码
|