Hi All,
I need some scripting help again. Not sure how much of this code is correct. It was put together in pieces. Right now it is erroring out when attempting to do the registry import. I also suspect the line calling the external VB script files is incorrect.
const Hidden = 0
Dim filesys
Dim strFileName
const WaitOnReturn = true
Set objNet = CreateObject("WScript.Network")
Set filesys = CreateObject("Scripting.FileSystemObject")
strCompName = objNet.ComputerName
set WshShell = CreateObject("WScript.Shell")
If left(strCompName,3) = "CMH" or left(strCompName,6) = "DMDIAB" then
If filesys.FileNotExists("C:\Program Files\Java\jre6\bin\java.dll") then
objShell.CurrentDirectory = "B:\cache"
FileSystemObject.CopyFile "B:\jre6u12.exe", "C:\Windows"
objShell.CurrentDirectory = "C:\Windows"
WshShell.Run "jre6u12.exe /s",1,True
objNetwork.MapNetworkDrive "B:", "\\cmhwaltps\e$\Program Files\Altiris\Altiris Agent\Package Delivery\{84F0ACD5-BEF6-4BF1-8923-D79B6B4F28BA}\cache"
objShell.CurrentDirectory = "B:\cache"
FileSystemObject.CopyFile "B:\davincian.ico", "C:\Windows"
SRegFile = "B:\vbsenable.reg"
objShell.Run "regedit.exe /s " Chr(34) & sRegFile & Chr(34), 0, True
strFileName = Chr(34) & "B:\DavincianL.vbs" & Chr(34)
strFileName = Chr(34) & "B:\DavincianT.vbs" & Chr(34)
Else
WshShell.Run "wscript " & strFileName, , True
End If
End If
All help is appreciated. Thank you.
I need some scripting help again. Not sure how much of this code is correct. It was put together in pieces. Right now it is erroring out when attempting to do the registry import. I also suspect the line calling the external VB script files is incorrect.
const Hidden = 0
Dim filesys
Dim strFileName
const WaitOnReturn = true
Set objNet = CreateObject("WScript.Network")
Set filesys = CreateObject("Scripting.FileSystemObject")
strCompName = objNet.ComputerName
set WshShell = CreateObject("WScript.Shell")
If left(strCompName,3) = "CMH" or left(strCompName,6) = "DMDIAB" then
If filesys.FileNotExists("C:\Program Files\Java\jre6\bin\java.dll") then
objShell.CurrentDirectory = "B:\cache"
FileSystemObject.CopyFile "B:\jre6u12.exe", "C:\Windows"
objShell.CurrentDirectory = "C:\Windows"
WshShell.Run "jre6u12.exe /s",1,True
objNetwork.MapNetworkDrive "B:", "\\cmhwaltps\e$\Program Files\Altiris\Altiris Agent\Package Delivery\{84F0ACD5-BEF6-4BF1-8923-D79B6B4F28BA}\cache"
objShell.CurrentDirectory = "B:\cache"
FileSystemObject.CopyFile "B:\davincian.ico", "C:\Windows"
SRegFile = "B:\vbsenable.reg"
objShell.Run "regedit.exe /s " Chr(34) & sRegFile & Chr(34), 0, True
strFileName = Chr(34) & "B:\DavincianL.vbs" & Chr(34)
strFileName = Chr(34) & "B:\DavincianT.vbs" & Chr(34)
Else
WshShell.Run "wscript " & strFileName, , True
End If
End If
All help is appreciated. Thank you.