Dim xOS, sPath, sReg Set objShellApp = CreateObject("Shell.Application") Set WshShell = CreateObject("Wscript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") xOS = "x64" sPath = Replace(WScript.ScriptFullName, WScript.ScriptName, "") sReg = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName") If sReg = "Microsoft Windows XP" Then objShellApp.ShellExecute """" & sPath & "\TOTALCMD.EXE""", "", "", "", 1 Else If WshShell.ExpandEnvironmentStrings("%PROCESSOR_ARCHITECTURE%") = "x86" And WshShell.ExpandEnvironmentStrings("%PROCESSOR_ARCHITEW6432%") = "%PROCESSOR_ARCHITEW6432%" Then xOS = "x86" If xOS = "x86" Then objShellApp.ShellExecute """" & sPath & "\TOTALCMD.EXE""", "", "", "runas", 1 ElseIf xOS = "x64" Then If FSO.FileExists(sPath & "\TOTALCMD64.EXE") Then objShellApp.ShellExecute """" & sPath & "\TOTALCMD64.EXE""", "", "", "runas", 1 Else objShellApp.ShellExecute """" & sPath & "\TOTALCMD.EXE""", "", "", "runas", 1 End If Else WScript.Echo "Что-то не так" End If End If |