strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
Set filesys = CreateObject("Scripting.FileSystemObject")
path = filesys.GetAbsolutePathName("c:\windows\system32\aexswdinstsvc.exe")
path2 = filesys.GetAbsolutePathName("c:\windows\system32\aexnsc.log")
For Each objOperatingSystem in colSettings
OS = objOperatingSystem.Name
OS_Version = objOperatingSystem.Version
OS_SP = objOperatingSystem.ServicePackMajorVersion & "." &
objOperatingSystem.ServicePackMinorVersion
Next
os_split = split(os, "|")
os = os_split(0)
wscript.echo "os: " & OS
Main()
sub Main
if os = "Microsoft Windows XP Professional" then
Exists = filesys.FileExists(path)
If Exists <> "True" Then
Copy()
End If
Exists2 = filesys.FileExists(path2)
if Exists2 = "True" then
exit sub
end if
Install()
wscript.echo "Made it here 1"
end if
End Sub
SUB Install
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "c:\windows\system32\aexswdinstsvc.exe -u
'http://netalp1/Altiris/ns/nscap/bin/win32/x86/ns client package/aexnsc.exe'
-s netalp1.pd.com -w http://netalp1/Altiris -NOSTARTMENU -NOTRAYICON"
wscript.echo "Made it here 3"
End Sub
sub Copy
wscript.echo "Made it here 2"
strFilePath = "\\netalp1\nscap\Bin\Win32\X86\aexswdinstsvc.exe"
strDestination ="c:\windows\system32\aexswdinstsvc.exe"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFileCopy = objFSO.GetFile(strFilePath)
objFileCopy.Copy (strDestination)
End Sub
Patrick - 06 Feb 2008 15:13 GMT
Sorry, I posted in this newsgroup twice, see "activeds.dll error" thread for
information.