[vb_ro] Re: Batch file

Sau ar mai fi exemplul asta, care merge pe orice windows care are wsh:

'************************************************
' File:    WinVersion.vbs (WSH sample in VBScript)=20
' Author:  G=FCnter Born
'
'
' Retrieve OS-Version number
' Attention: Requires WSHSystem.ocx
' Check out Born's Windows Scripting Host Bazaar at:
' http://ourworld.compuserve.com/homepages/Guenter_Born/index0.htm
'
' In no way shall the author be liable for any
' losses or damages resulting from the use of this
' program. Use AS-IS at your own risk.
'
' The code is the property of the author. You may
' use the code and modify it, as far as this header
' remains intact. Further updates and other samples
' may be found on my site mentioned above.

'************************************************
Option Explicit

Const xMajorVer =3D 1
Const xMinorVer =3D 2
Const xBuild =3D 3
Const xPlatform =3D 4
Const xTxt =3D 5

Const VER_PLATFORM_WIN32s =3D 0
Const VER_PLATFORM_WIN32_WINDOWS =3D 1
Const VER_PLATFORM_WIN32_NT =3D 2

Dim objAdr, Text, Title, OSName

 Title =3D "Operating System Information - by G=FCnter Born"
 Text =3D "Windows Properties" & vbCRLF

' Get a reference to the WSHExtend control
 Set objAdr =3D WScript.CreateObject("WSHSystem.WinSys")

 objAdr.WSHOsSysInfo               ' Get Windows-OS-Info

 Text =3D Text + "Platform "
' Estimate OS-Platform
 Select Case objAdr.OsSysInfoValue(xPlatform)
 Case VER_PLATFORM_WIN32_WINDOWS
  If objAdr.OsSysInfoValue(xMajorVer) =3D 4 _
   And objAdr.OsSysInfoValue(xMinorVer) =3D 0 Then
    Text =3D Text & "Windows 95"
  Else
    Text =3D Text & "Windows 98"
  End If

 Case VER_PLATFORM_WIN32_NT
  If objAdr.OsSysInfoValue(xMajorVer) =3D 5 _
   And objAdr.OsSysInfoValue(xMinorVer) =3D 0 Then
    Text =3D Text & "Windows 2000"
  Else
    Text =3D Text & "Windows NT 4.x"
  End If
 Case Else
  Text =3D Text & "---"
 End Select

 Text =3D Text & vbCRLF

' Extract other Operating System Properties
 Text =3D Text & "Version " & objAdr.OsSysInfoValue(xMajorVer)
 Text =3D Text & "." & objAdr.OsSysInfoValue(xMinorVer) & vbCRLF
 Text =3D Text & "Build " & (objAdr.OsSysInfoValue(xBuild) AND &HFFF)=20
 Text =3D Text & " " & objAdr.OsSysInfoValue(xTxt) & vbCRLF

 MsgBox Text, vbOkOnly + vbInformation, Title

 WScript.Quit()
' End
 =20


-----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: