各位前輩~
我公司目前Logan script會在登入時檢查作業系統版本然後安裝某些軟體
但只有win7登入時會作動,現在想加入win8 & win8.1 &win10
請問該如何修改?
內容如下 :
If PCName = "IRVINE-LIU-N01" Then
Else
Set objOSs = objWMIService.ExecQuery ("Select Caption from Win32_OperatingSystem")
For Each objOS In objOSs
'Wscript.Echo "OS:" & objOS.caption
If objOS.Caption = "Microsoft Windows XP Professional" Then
'WScript.Sleep 12000
'Wscript.Echo "os is : " & objOS.Caption & " Sleep 10 second "
Set objFSO = CreateObject("Scripting.FileSystemObject")
If Not objFSO.FileExists("C:\Program Files\Sophos\AutoUpdate\ALsvc.exe") Then
If PCName = "sayuri-peng" Or PCName = "IT-R401" Then
'Wscript.Echo "Sophos install jump!!"
Else
'Wscript.Echo "Install Sophos, Please waiting a moment!! "
cmdstr="\\ICHSSAV01\SophosUpdate\sophos-install.bat"
result=objShell.run("%comspec% /c " & cmdstr,0,true)
'
End If
End If
If Not objFSO.FileExists("C:\Program Files\OCS Inventory Agent\OCSService.exe") Then
'Wscript.Echo "Install Sophos, Please waiting a moment!! "
cmdstr="\\ichsfs01.icatchtek.com.tw\SW\GeneralSW\OCS\DeployPackage\OCSPACKAGE.exe"
result=objShell.run("%comspec% /c " & cmdstr,0,true)
End If '
End If
'Wscript.Echo "before win 7 detect ... "
'If objOS.Caption = "Microsoft Windows 7 專業版" Then
If Left(objOS.Caption,19) = "Microsoft Windows 7" Then
'WScript.Sleep 12000
'Wscript.Echo "os is : " & objOS.Caption & " Sleep 10 second "
Set objFSO = CreateObject("Scripting.FileSystemObject")
If Not objFSO.FileExists("C:\Program Files\Sophos\Sophos Anti-Virus\SavService.exe") and Not objFSO.FileExists("C:\Program Files (x86)\Sophos\AutoUpdate\ALsvc.exe") Then
If PCName = "IT-R405" Or PCName = "IT-R401" or PCName = "edward-kuo-n02" Then
'Wscript.Echo "Sophos install jump!!"
Else
'Wscript.Echo "Install Sophos, Please waiting a moment!! "
cmdstr="\\ICHSSAV01\SophosUpdate\sophos-install.bat"
result=objShell.run("%comspec% /c " & cmdstr,0,true)
'
End If
End If
If Not objFSO.FileExists("C:\Program Files\OCS Inventory Agent\OcsService.exe") and Not objFSO.FileExists("C:\Program Files (x86)\OCS Inventory Agent\OcsService.exe") Then
'Wscript.Echo "Install Sophos, Please waiting a moment!! "
cmdstr="\\ichsfs01.icatchtek.com.tw\SW\GeneralSW\OCS\DeployPackage\OCSPACKAGE.exe"
result=objShell.run("%comspec% /c " & cmdstr,0,true)
End If '
End If
Next
End If
'
Set objWord = CreateObject("Word.Application")
objWord.UserName = objUser.cn
objWord.UserInitials = Left(objUser.cn, 1) & Left(objUser.SN, 1)
objWord.Quit