Thursday, October 16, 2008

open file - security warning

In our SCCM environment we frequently use the option to run from server instead of download and run.  One of the issues we've seen from time to time is if our script calls another program that was downloaded from the internet it may have had the untrusted source bit set during the download.  In our scripts we get around the Open File - Security warning dialog box by temporarily turning off zone checking.  At the end of the script we turn zone checking back on.  No need to add servers to trusted sites via group policy!  More info on this problem here:

set objShell = CreateObject("Wscript.shell")
Set objEnv = objShell.Environment("PROCESS")

' ********************************************************************************
'Main Routine
'*********************************************************************************
objEnv("SEE_MASK_NOZONECHECKS") = 1
objShell.Run("taskkill.exe /F /IM foo.exe"),,False
Install_Application()
objEnv.Remove("SEE_MASK_NOZONECHECKS")
WSCRIPT.QUIT

' ********************************************************************************
'Install Application
'*********************************************************************************
Function Install_Application()
'setup program
objShell.run("fooInstall.exe /silent"),1,true
Wscript.Sleep(5000)
End Function

No comments: