Befehlszeile erstellen

Kommentar: Starter für Executable                         
Benutzernamen, OS und Bitbreite auslesen                                     
Aus den Infos wird dann eine Befehlszeile

 

 

option explicit
on error resume next

Dim wshell, OS, Architecture
Dim strComputer , objWMIService, colItems, objItem
Dim ClouString, ProgFile, temp,xyz

set wshell = createobject("wscript.shell")

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)

progfile = wShell.ExpandEnvironmentStrings("%ProgramFiles%")
temp = wShell.ExpandEnvironmentStrings("%Temp%")

For Each objItem in colItems
OS = objItem.caption 
If left(OS,19) = "Microsoft Windows 7" then
Architecture = objItem.OSArchitecture
end if
next

If left(OS,19) = "Microsoft Windows 7" then
If Architecture="32-Bit" then
ClouString = """" & ProgFile & "\ClouCS59A1\clou4win.exe""" & " /C /w- /i clou4win59a1.ini /B " & temp
else
ProgFile = wShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%")
ClouString = """" & ProgFile & "\ClouCS59A1\clou4win.exe""" & " /C /w- /i clou4win59a1.ini /B " & temp
end if
else
ClouString = """" & ProgFile & "\ClouCS59A1\clou4win.exe""" & " /C /w- /i clou4win59a1.ini /B " & temp
end if

wshell.run Cloustring,1

 

  • Dienstag, 13 März 2018

Leave a comment

You are commenting as guest.