[vb_ro] Re: Batch file

doua exemple luate de la M$; din pacate, ambele depind de wmi, si deci
aplicabile pe win2k, winxp, winnt(nu sunt foarte sigur)

strComputer =3D "."
Set objWMIService =3D GetObject("winmgmts:" _
    & "{impersonationLevel=3Dimpersonate}!\\" & strComputer &
"\root\cimv2")
Set colOperatingSystems =3D objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
    Wscript.Echo "Boot Device: " & objOperatingSystem.BootDevice
    Wscript.Echo "Build Number: " & objOperatingSystem.BuildNumber
    Wscript.Echo "Build Type: " & objOperatingSystem.BuildType
    Wscript.Echo "Caption: " & objOperatingSystem.Caption
    Wscript.Echo "Code Set: " & objOperatingSystem.CodeSet
    Wscript.Echo "Country Code: " & objOperatingSystem.CountryCode
    Wscript.Echo "Debug: " & objOperatingSystem.Debug
    Wscript.Echo "Encryption Level: " &
objOperatingSystem.EncryptionLevel
    dtmInstallDate =3D dtmConvertedDate.GetVarDate
    Wscript.Echo "Install Date: " & dtmInstallDate=20
    Wscript.Echo "Licensed Users: " & _
        objOperatingSystem.NumberOfLicensedUsers
    Wscript.Echo "Organization: " & objOperatingSystem.Organization
    Wscript.Echo "OS Language: " & objOperatingSystem.OSLanguage
    Wscript.Echo "OS Product Suite: " &
objOperatingSystem.OSProductSuite
    Wscript.Echo "OS Type: " & objOperatingSystem.OSType
    Wscript.Echo "Primary: " & objOperatingSystem.Primary
    Wscript.Echo "Registered User: " & objOperatingSystem.RegisteredUser
    Wscript.Echo "Serial Number: " & objOperatingSystem.SerialNumber
    Wscript.Echo "Version: " & objOperatingSystem.Version
Next=20

//--------------------------------

strComputer =3D "."
Set objWMIService =3D GetObject("winmgmts:" _
    & "{impersonationLevel=3Dimpersonate}!\\" & strComputer &
"\root\cimv2")
Set colSettings =3D objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colSettings=20
    Wscript.Echo "OS Name: " & objOperatingSystem.Name
    Wscript.Echo "Version: " & objOperatingSystem.Version
    Wscript.Echo "Service Pack: " & _
        objOperatingSystem.ServicePackMajorVersion _
            & "." & objOperatingSystem.ServicePackMinorVersion
    Wscript.Echo "OS Manufacturer: " & objOperatingSystem.Manufacturer
    Wscript.Echo "Windows Directory: " & _
        objOperatingSystem.WindowsDirectory
    Wscript.Echo "Locale: " & objOperatingSystem.Locale
    Wscript.Echo "Available Physical Memory: " & _
        objOperatingSystem.FreePhysicalMemory
    Wscript.Echo "Total Virtual Memory: " & _
        objOperatingSystem.TotalVirtualMemorySize
    Wscript.Echo "Available Virtual Memory: " & _
        objOperatingSystem.FreeVirtualMemory
    Wscript.Echo "OS Name: " &
objOperatingSystem.SizeStoredInPagingFiles
Next
Set colSettings =3D objWMIService.ExecQuery _
    ("Select * from Win32_ComputerSystem")
For Each objComputer in colSettings=20
    Wscript.Echo "System Name: " & objComputer.Name
    Wscript.Echo "System Manufacturer: " & objComputer.Manufacturer
    Wscript.Echo "System Model: " & objComputer.Model
    Wscript.Echo "Time Zone: " & objComputer.CurrentTimeZone
    Wscript.Echo "Total Physical Memory: " & _
        objComputer.TotalPhysicalMemory
Next
Set colSettings =3D objWMIService.ExecQuery _
    ("Select * from Win32_Processor")
For Each objProcessor in colSettings=20
    Wscript.Echo "System Type: " & objProcessor.Architecture
    Wscript.Echo "Processor: " & objProcessor.Description
Next
Set colSettings =3D objWMIService.ExecQuery _
    ("Select * from Win32_BIOS")
For Each objBIOS in colSettings=20
    Wscript.Echo "BIOS Version: " & objBIOS.Version
Next

Alex


-----Original Message-----
From: Alexandrache, Alexandru [mailto:AAlexandrache@xxxxxxxxx]=20
Sent: Monday, September 01, 2003 6:18 PM
To: vb_ro@xxxxxxxxxxxxx

Este cu adevarat relevant pt tine daca este Server sau Workstation?
Daca e un script administrativ probabil este, dar daca vrei asta doar pt
a instala o aplicatie nu este...
Din cate stiu eu intre binarele cele doua versiuni (svr & wrk) nu exista
nici-o diferenta, e doar o problema de licente, si de factori default la
mecanismele de performanta...In plus in kitul versiunilor server sunt
incluse mai multe servicii...=20
Citisem undeva ca la un win NT wrk daca schimbai o anume cheie in
registrii la bootare scria ca e WinNT server

Eu am Win2000 Server si daca dau Properties pe My Computer scrie doar
"Windows 2000"...
Ca sa afli daca e Server sau Wrk cred ca trebuie sa treci prin
registrii...




From: Alex Uifalean
Sent: Mon 01/09/2003 17:02
To: vb_ro@xxxxxxxxxxxxx
Subject: [vb_ro] Re: Batch file


Salut si multumesc pentru raspuns am gasit o solutie pentru a rezolva
ceea ce vroiam acuma mai ramane un singur lucru sa gasesc.
Solutia este ceva de genul:

@echo off
SET string=3D
VER | FIND /I "Windows 2000" >NUL
IF NOT ERRORLEVEL 1 SET string=3DWindows 2000 VER | FIND /I "Windows XP"
>NUL IF NOT ERRORLEVEL 1 SET string=3DWindows XP VER | FIND /I "Windows
95" >NUL IF NOT ERRORLEVEL 1 SET string=3DWindows 95 VER | FIND /I
"Windows 98" >NUL IF NOT ERRORLEVEL 1 SET string=3DWindows 98 VER | FIND
/I "Windows NT" >NUL IF NOT ERRORLEVEL 1 SET string=3DWindows NT VER |
FIND /I "Windows Mil" >NUL IF NOT ERRORLEVEL 1 SET string=3DWindows ME

acum problema pe care trebuie sa o mai rezolv este sa pot sa verific
daca de ex este 2000 server instalat sau nt server

Alex


----- Original Message -----
From: "Alexandrache, Alexandru" <AAlexandrache@xxxxxxxxx>
To: <vb_ro@xxxxxxxxxxxxx>
Sent: Monday, September 01, 2003 5:57 PM
Subject: [vb_ro] Re: Batch file


> poti incerca cu variabila de system %OS% Pe windows 2000 c:\> ECHO=20
> %OS% returneaza  "Windows_NT"
> vezi ce returneaza in cazul unui win95, Win 98, ME
>
> Daca nu satisface, trebuie sa parse-ui outputul lui VER.
> GREP pt windows: http://www.interlog.com/~tcharron/grep.html
> Asta daca vrei s-o faci la nivel de batch...
>
>
>
>
>
>
>
> From: Alex Uifalean
> Sent: Mon 01/09/2003 15:47
> To: vb_ro@xxxxxxxxxxxxx
> Subject: [vb_ro] Batch file
>
>
> Salut,
> nu prea tine de vb ceea ce vreau sa va intreb insa poate cineva dintre

> voi
a
> facut asa ceva si anume:
> trebuie sa creez un bat care sa-mi verifice versiunea de windows=20
> instalata si in functie de aceasta sa fac ceva.
>
>
> if versiune=3D95 fa ceva
> if versiune=3D98 fa ceva
>
>
> etc...
>
> Ma poate ajuta cineva?
> Multumesc,
> Alex
>
>
>
> Site: http://info.AdvanCode.com
> Dezabonare: vb_ro-request@xxxxxxxxxxxxx cu "unsubscribe" la subiect.
>
> Site: http://info.AdvanCode.com
> Dezabonare: vb_ro-request@xxxxxxxxxxxxx cu "unsubscribe" la subiect.


Site: http://info.AdvanCode.com
Dezabonare: vb_ro-request@xxxxxxxxxxxxx cu "unsubscribe" la subiect.

Site: http://info.AdvanCode.com
Dezabonare: vb_ro-request@xxxxxxxxxxxxx cu "unsubscribe" la subiect.



-------------------------------------------------------------------------=
------
The content of this communication is classified as Mobifon SA Romania =
Confidential and Proprietary Information.The content of this =
communication is intended solely for the use of the individual or entity =
to whom it is addressed and others authorized to receive it. If you are =
not the intended recipient you are hereby notified that any disclosure, =
copying, distribution or taking any action in reliance on the contents =
of this information is strictly prohibited and may be unlawful. If you =
have received this communication in error, please notify us immediately =
by responding to this communication then delete it from your system. We =
appreciate your assistance in preserving the confidentiality of our =
correspondence. Thank you.

Prezentul mesaj constituie o Informatie confidentiala si este =
proprietatea exclusiva a  MobiFon S.A.. Mesajul se adreseaza numai =
persoanei fizice sau juridice mentionata ca destinatara, precum si altor =
persoane autorizate sa-l primeasca. In cazul in care nu sunteti =
destinatarul vizat, va aducem la cunostinta ca dezvaluirea, copierea, =
distribuirea sau initierea unor actiuni pe baza prezentei informatii =
sunt strict interzise si atrag raspunderea civila si penala. Daca ati =
primit acest mesaj dintr-o eroare, va rugam sa ne anuntati imediat, ca =
raspuns la mesajul de fata, si sa-l stergeti apoi din sistemul dvs. =
Apreciem si va multumim pentru sprijinul acordat in pastrarea =
confidentialitatii corespondentei noastre.=20
-------------------------------------------------------------------------=
------
Site: http://info.AdvanCode.com
Dezabonare: vb_ro-request@xxxxxxxxxxxxx cu "unsubscribe" la subiect.

Other related posts: