network path file execution security warning

2 posts in this topic

I am very new to AutoIt. I am working on various install scripts and am repeatedly running into the same problem of a security warning when launching the file. Below is an example of one of my scripts. It is currently using the 'run' command to launch the setup file, but I have also tested with 'shellexecute' and '_rundos'. What is the best/recommended command for launching a setup file from a UNC network path and how can I circumvent this security warning? Thanks in advance!



; ********** Define Parameters **********
#include <date.au3>
#include <File.au3>
#include <Process.au3> ;required for _RunDOS command below
Local $tCur, $logfile
$tCur = _Date_Time_GetLocalTime()
$logfile = 'C:\AI_SQLnativeclient_Install.LOG'
AutoItSetOption('MouseCoordMode', 0)

; ********** Launch installer **********
Local $32bitsetup
Local $64bitsetup
$32bitsetup = "\\domainname.local\DFS1\Z GM  Info Technology\Install\SQL Native Client\sqlncli.msi"
$64bitsetup = "\\domainname.local\DFS1\Z GM  Info Technology\Install\SQL Native Client\sqlncli_x64.msi"

_FileWriteLog($logfile, '**********************************************************************' & @CRLF)
_FileWriteLog($logfile, 'BEGIN PROCESS' & @CRLF & @CRLF & @CRLF)

If @OSArch = 'X86' Then
    _FileWriteLog($logfile, 'FILE PATH -  ' & $32bitsetup & @CRLF)
ElseIf @OSArch = 'X64' Then
    _FileWriteLog($logfile, 'FILE PATH -  ' & $32bitsetup & @CRLF)

run('\\domainname.local\DFS1\Z GM  Info Technology\Install\SQL Native Client\sqlncli.msi')      ; temp test in place of if/then below

If @OSArch = 'X86' Then
    ;MsgBox(0, 'path', $32bitsetup)        ;temporary test messagebox in place of run command above
ElseIf @OSArch = 'X64' Then
    ;MsgBox(0, 'path', $64bitsetup)   ;temporary test messagebox in place of run command above

Share this post

Link to post
Share on other sites

This kind of warning is a standard behaviour of Windows, according to the Internet Explorer configuration.

To avoid a security warning appears when you launch a program from a network path, just add the server name in the Intranet Zone of Internet Explorer (for example, add file://MyServername when the program is stored in \\MyServername\someshare\program.exe).

Of course, you can automate in your script (best way should be the use of a Group Policy if you have the possibility) :

Local $sServername = "MyServername"
RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\" &$sServername, "file", "REG_DWORD", 2) ; add file://MyServername site in the Intranet Zone


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now