j'automatise une installation de soft sur 2000 avec les
fichier de reponse ISS.
ceci est appele par un batch
le probleme:
comment puis-je indiquer que selon la version de l'os le
setup.exe se lance avec tel ou tel fichier iss,
(actuellement je dois faire un rep par version)
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Clive Lumb
Tu peut t'inspirer de cette fonction en vbs qui détermine la version et langage de l'OS pour l'installation du SP4 de Win2K.
On Error Resume Next Const W2K_SP4en = "w2ksp4_en.exe" Const W2K_SP4fr = "w2ksp4_fr.exe" ip="111.222.333.444" 'exemple ! set osvcRemote = GetObject("winmgmts:" & ip & "rootcimv2") if (Err.Number <> 0) then wscript.echo "Failed to connect to " & ip & "." else exeCorrectPatch = detectOSPatch(osvcRemote) end if ------------------------------------------------ Function detectOSPatch(osvcRemote) Set oOSInfo = osvcRemote.InstancesOf("Win32_OperatingSystem") 'Only one instance is ever returned (the currently active OS), even though the following is a foreach. For Each objOperatingSystem In oOSInfo If (objOperatingSystem.OSType <> 18) Then ' Make sure that this computer is Windows NT-based. wscript.echo ip & " is not a Windows XP, Windows 2000, or Windows 2003 Server computer." Else If (objOperatingSystem.Version = "5.0.2195") Then ' Windows 2000. If (objOperatingSystem.ServicePackMajorVersion <> 4) Then ' SP4 not installed If (objOperatingSystem.CountryCode = 33) Then 'French wscript.echo "French" systemType = exeW2kfr End If If (objOperatingSystem.CountryCode = 1) Then 'US English wscript.echo "US English" systemType = exeW2ken End If Else wscript.echo "Could not patch " & ip & " - SP4 already installed" End If Else 'This was a Windows NT-based computer, but not with a valid service pack. wscript.echo "Could not patch " & ip & " - unhandled OS version: " & objOperatingSystem.Caption & " SP" & objOperatingSystem.ServicePackMajorVersion & "(" & objOperatingSystem.Version & ")" End If End If Next detectOSPatch = systemType End Function
"fred" a écrit dans le message de news:433b01c42b71$451f1420$
salut
j'automatise une installation de soft sur 2000 avec les fichier de reponse ISS. ceci est appele par un batch
le probleme:
comment puis-je indiquer que selon la version de l'os le setup.exe se lance avec tel ou tel fichier iss, (actuellement je dois faire un rep par version)
merci de votre aide
Tu peut t'inspirer de cette fonction en vbs qui détermine la version et
langage de l'OS pour l'installation du SP4 de Win2K.
On Error Resume Next
Const W2K_SP4en = "w2ksp4_en.exe"
Const W2K_SP4fr = "w2ksp4_fr.exe"
ip="111.222.333.444" 'exemple !
set osvcRemote = GetObject("winmgmts:\" & ip & "rootcimv2")
if (Err.Number <> 0) then
wscript.echo "Failed to connect to " & ip & "."
else
exeCorrectPatch = detectOSPatch(osvcRemote)
end if
------------------------------------------------
Function detectOSPatch(osvcRemote)
Set oOSInfo = osvcRemote.InstancesOf("Win32_OperatingSystem")
'Only one instance is ever returned (the currently active OS), even
though the following is a foreach.
For Each objOperatingSystem In oOSInfo
If (objOperatingSystem.OSType <> 18) Then
' Make sure that this computer is Windows NT-based.
wscript.echo ip & " is not a Windows XP, Windows 2000, or
Windows 2003 Server computer."
Else
If (objOperatingSystem.Version = "5.0.2195") Then
' Windows 2000.
If (objOperatingSystem.ServicePackMajorVersion <> 4) Then
' SP4 not installed
If (objOperatingSystem.CountryCode = 33) Then
'French
wscript.echo "French"
systemType = exeW2kfr
End If
If (objOperatingSystem.CountryCode = 1) Then
'US English
wscript.echo "US English"
systemType = exeW2ken
End If
Else
wscript.echo "Could not patch " & ip & " - SP4 already
installed"
End If
Else
'This was a Windows NT-based computer, but not with a valid
service pack.
wscript.echo "Could not patch " & ip & " - unhandled OS
version: " & objOperatingSystem.Caption & " SP" &
objOperatingSystem.ServicePackMajorVersion & "(" &
objOperatingSystem.Version & ")"
End If
End If
Next
detectOSPatch = systemType
End Function
"fred" <anonymous@discussions.microsoft.com> a écrit dans le message de
news:433b01c42b71$451f1420$a501280a@phx.gbl...
salut
j'automatise une installation de soft sur 2000 avec les
fichier de reponse ISS.
ceci est appele par un batch
le probleme:
comment puis-je indiquer que selon la version de l'os le
setup.exe se lance avec tel ou tel fichier iss,
(actuellement je dois faire un rep par version)
Tu peut t'inspirer de cette fonction en vbs qui détermine la version et langage de l'OS pour l'installation du SP4 de Win2K.
On Error Resume Next Const W2K_SP4en = "w2ksp4_en.exe" Const W2K_SP4fr = "w2ksp4_fr.exe" ip="111.222.333.444" 'exemple ! set osvcRemote = GetObject("winmgmts:" & ip & "rootcimv2") if (Err.Number <> 0) then wscript.echo "Failed to connect to " & ip & "." else exeCorrectPatch = detectOSPatch(osvcRemote) end if ------------------------------------------------ Function detectOSPatch(osvcRemote) Set oOSInfo = osvcRemote.InstancesOf("Win32_OperatingSystem") 'Only one instance is ever returned (the currently active OS), even though the following is a foreach. For Each objOperatingSystem In oOSInfo If (objOperatingSystem.OSType <> 18) Then ' Make sure that this computer is Windows NT-based. wscript.echo ip & " is not a Windows XP, Windows 2000, or Windows 2003 Server computer." Else If (objOperatingSystem.Version = "5.0.2195") Then ' Windows 2000. If (objOperatingSystem.ServicePackMajorVersion <> 4) Then ' SP4 not installed If (objOperatingSystem.CountryCode = 33) Then 'French wscript.echo "French" systemType = exeW2kfr End If If (objOperatingSystem.CountryCode = 1) Then 'US English wscript.echo "US English" systemType = exeW2ken End If Else wscript.echo "Could not patch " & ip & " - SP4 already installed" End If Else 'This was a Windows NT-based computer, but not with a valid service pack. wscript.echo "Could not patch " & ip & " - unhandled OS version: " & objOperatingSystem.Caption & " SP" & objOperatingSystem.ServicePackMajorVersion & "(" & objOperatingSystem.Version & ")" End If End If Next detectOSPatch = systemType End Function
"fred" a écrit dans le message de news:433b01c42b71$451f1420$
salut
j'automatise une installation de soft sur 2000 avec les fichier de reponse ISS. ceci est appele par un batch
le probleme:
comment puis-je indiquer que selon la version de l'os le setup.exe se lance avec tel ou tel fichier iss, (actuellement je dois faire un rep par version)
merci de votre aide
l'executable est toujours le meme c'est le fichier de reponse uniquement qui change, il faut un truc genre "if...then setup.exe + reponse.iss"
-----Message d'origine----- Tu peut t'inspirer de cette fonction en vbs qui détermine la version et
langage de l'OS pour l'installation du SP4 de Win2K.
On Error Resume Next Const W2K_SP4en = "w2ksp4_en.exe" Const W2K_SP4fr = "w2ksp4_fr.exe" ip="111.222.333.444" 'exemple ! set osvcRemote = GetObject("winmgmts:" & ip & "rootcimv2")
if (Err.Number <> 0) then wscript.echo "Failed to connect to " & ip & "." else exeCorrectPatch = detectOSPatch(osvcRemote) end if ------------------------------------------------ Function detectOSPatch(osvcRemote) Set oOSInfo = osvcRemote.InstancesOf ("Win32_OperatingSystem")
'Only one instance is ever returned (the currently active OS), even
though the following is a foreach. For Each objOperatingSystem In oOSInfo If (objOperatingSystem.OSType <> 18) Then ' Make sure that this computer is Windows NT- based.
wscript.echo ip & " is not a Windows XP, Windows 2000, or
Windows 2003 Server computer." Else If (objOperatingSystem.Version = "5.0.2195") Then
' Windows 2000. If (objOperatingSystem.ServicePackMajorVersion <> 4) Then
' SP4 not installed If (objOperatingSystem.CountryCode = 33) Then
'French wscript.echo "French" systemType = exeW2kfr End If If (objOperatingSystem.CountryCode = 1) Then
'US English wscript.echo "US English" systemType = exeW2ken End If Else wscript.echo "Could not patch " & ip & " - SP4 already
installed" End If Else 'This was a Windows NT-based computer, but not with a valid
service pack. wscript.echo "Could not patch " & ip & " - unhandled OS
version: " & objOperatingSystem.Caption & " SP" & objOperatingSystem.ServicePackMajorVersion & "(" & objOperatingSystem.Version & ")" End If End If Next detectOSPatch = systemType End Function
"fred" a écrit dans le message de
news:433b01c42b71$451f1420$
salut
j'automatise une installation de soft sur 2000 avec les fichier de reponse ISS. ceci est appele par un batch
le probleme:
comment puis-je indiquer que selon la version de l'os le
setup.exe se lance avec tel ou tel fichier iss, (actuellement je dois faire un rep par version)
merci de votre aide
.
l'executable est toujours le meme c'est le fichier de
reponse uniquement qui change, il faut un truc genre
"if...then setup.exe + reponse.iss"
-----Message d'origine-----
Tu peut t'inspirer de cette fonction en vbs qui
détermine la version et
langage de l'OS pour l'installation du SP4 de Win2K.
On Error Resume Next
Const W2K_SP4en = "w2ksp4_en.exe"
Const W2K_SP4fr = "w2ksp4_fr.exe"
ip="111.222.333.444" 'exemple !
set osvcRemote = GetObject("winmgmts:\" & ip
& "rootcimv2")
if (Err.Number <> 0) then
wscript.echo "Failed to connect to " & ip & "."
else
exeCorrectPatch = detectOSPatch(osvcRemote)
end if
------------------------------------------------
Function detectOSPatch(osvcRemote)
Set oOSInfo = osvcRemote.InstancesOf
("Win32_OperatingSystem")
'Only one instance is ever returned (the currently
active OS), even
though the following is a foreach.
For Each objOperatingSystem In oOSInfo
If (objOperatingSystem.OSType <> 18) Then
' Make sure that this computer is Windows NT-
based.
wscript.echo ip & " is not a Windows XP,
Windows 2000, or
Windows 2003 Server computer."
Else
If (objOperatingSystem.Version = "5.0.2195")
Then
' Windows 2000.
If
(objOperatingSystem.ServicePackMajorVersion <> 4) Then
' SP4 not installed
If (objOperatingSystem.CountryCode =
33) Then
'French
wscript.echo "French"
systemType = exeW2kfr
End If
If (objOperatingSystem.CountryCode =
1) Then
'US English
wscript.echo "US English"
systemType = exeW2ken
End If
Else
wscript.echo "Could not patch " & ip
& " - SP4 already
installed"
End If
Else
'This was a Windows NT-based computer,
but not with a valid
service pack.
wscript.echo "Could not patch " & ip
& " - unhandled OS
version: " & objOperatingSystem.Caption & " SP" &
objOperatingSystem.ServicePackMajorVersion & "(" &
objOperatingSystem.Version & ")"
End If
End If
Next
detectOSPatch = systemType
End Function
"fred" <anonymous@discussions.microsoft.com> a écrit
dans le message de
news:433b01c42b71$451f1420$a501280a@phx.gbl...
salut
j'automatise une installation de soft sur 2000 avec les
fichier de reponse ISS.
ceci est appele par un batch
le probleme:
comment puis-je indiquer que selon la version de l'os
le
setup.exe se lance avec tel ou tel fichier iss,
(actuellement je dois faire un rep par version)
l'executable est toujours le meme c'est le fichier de reponse uniquement qui change, il faut un truc genre "if...then setup.exe + reponse.iss"
-----Message d'origine----- Tu peut t'inspirer de cette fonction en vbs qui détermine la version et
langage de l'OS pour l'installation du SP4 de Win2K.
On Error Resume Next Const W2K_SP4en = "w2ksp4_en.exe" Const W2K_SP4fr = "w2ksp4_fr.exe" ip="111.222.333.444" 'exemple ! set osvcRemote = GetObject("winmgmts:" & ip & "rootcimv2")
if (Err.Number <> 0) then wscript.echo "Failed to connect to " & ip & "." else exeCorrectPatch = detectOSPatch(osvcRemote) end if ------------------------------------------------ Function detectOSPatch(osvcRemote) Set oOSInfo = osvcRemote.InstancesOf ("Win32_OperatingSystem")
'Only one instance is ever returned (the currently active OS), even
though the following is a foreach. For Each objOperatingSystem In oOSInfo If (objOperatingSystem.OSType <> 18) Then ' Make sure that this computer is Windows NT- based.
wscript.echo ip & " is not a Windows XP, Windows 2000, or
Windows 2003 Server computer." Else If (objOperatingSystem.Version = "5.0.2195") Then
' Windows 2000. If (objOperatingSystem.ServicePackMajorVersion <> 4) Then
' SP4 not installed If (objOperatingSystem.CountryCode = 33) Then
'French wscript.echo "French" systemType = exeW2kfr End If If (objOperatingSystem.CountryCode = 1) Then
'US English wscript.echo "US English" systemType = exeW2ken End If Else wscript.echo "Could not patch " & ip & " - SP4 already
installed" End If Else 'This was a Windows NT-based computer, but not with a valid
service pack. wscript.echo "Could not patch " & ip & " - unhandled OS
version: " & objOperatingSystem.Caption & " SP" & objOperatingSystem.ServicePackMajorVersion & "(" & objOperatingSystem.Version & ")" End If End If Next detectOSPatch = systemType End Function
"fred" a écrit dans le message de
news:433b01c42b71$451f1420$
salut
j'automatise une installation de soft sur 2000 avec les fichier de reponse ISS. ceci est appele par un batch
le probleme:
comment puis-je indiquer que selon la version de l'os le
setup.exe se lance avec tel ou tel fichier iss, (actuellement je dois faire un rep par version)