User Tools

Site Tools


preventing_20the_20_27downloaded_20file_27_20warning

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

preventing_20the_20_27downloaded_20file_27_20warning [2018/03/31 13:19]
127.0.0.1 external edit
preventing_20the_20_27downloaded_20file_27_20warning [2018/04/17 18:16] (current)
tbest3112 Added syntax highlighting
Line 2: Line 2:
  
 //by Richard Russell, June 2009//\\ \\  When you attempt to run an executable file downloaded from the internet (or another computer), Windows may display a '​security warning'​ dialogue box requiring confirmation before the file is run. This can happen when an NTFS filesystem is in use on Windows XP (SP2 or later), Windows Vista or Windows 7:\\ \\ {{secwarn.gif}}\\ \\  Whilst this warning is a valuable security measure, it can be irritating when you know the file to be safe, especially in the context of a file you want to run frequently (such as an add-in utility).\\ \\  It is easy enough to disable this warning manually, either by deselecting the '​Always ask before opening this file' checkbox, or by right-clicking on the file in Windows Explorer, selecting **Properties...** then the **General** tab then clicking on **Unblock**.\\ \\  However you may want to spare the user the need to do this by automatically disabling the warning in software, for example when an installer program is run. You can easily do that using the following BBC BASIC code:\\ \\  //by Richard Russell, June 2009//\\ \\  When you attempt to run an executable file downloaded from the internet (or another computer), Windows may display a '​security warning'​ dialogue box requiring confirmation before the file is run. This can happen when an NTFS filesystem is in use on Windows XP (SP2 or later), Windows Vista or Windows 7:\\ \\ {{secwarn.gif}}\\ \\  Whilst this warning is a valuable security measure, it can be irritating when you know the file to be safe, especially in the context of a file you want to run frequently (such as an add-in utility).\\ \\  It is easy enough to disable this warning manually, either by deselecting the '​Always ask before opening this file' checkbox, or by right-clicking on the file in Windows Explorer, selecting **Properties...** then the **General** tab then clicking on **Unblock**.\\ \\  However you may want to spare the user the need to do this by automatically disabling the warning in software, for example when an installer program is run. You can easily do that using the following BBC BASIC code:\\ \\ 
 +<code bb4w>
           file% = OPENIN(FileName$ + ":​Zone.Identifier"​)           file% = OPENIN(FileName$ + ":​Zone.Identifier"​)
           IF file% THEN           IF file% THEN
Line 8: Line 9:
             IF file% CLOSE #file%             IF file% CLOSE #file%
           ENDIF           ENDIF
 +</​code>​
 This code first checks to see if the file has a '​Zone.Identifier'​ stream, and if so replaces it with an empty stream; it will require Administrator Privileges to run.\\ \\  Obviously you should only do this in circumstances when you are sure the file is safe, because you are bypassing a Windows security feature.\\ \\  This code first checks to see if the file has a '​Zone.Identifier'​ stream, and if so replaces it with an empty stream; it will require Administrator Privileges to run.\\ \\  Obviously you should only do this in circumstances when you are sure the file is safe, because you are bypassing a Windows security feature.\\ \\ 
 ==== Note ==== ==== Note ====
  This article is applicable to files which have first been downloaded from the internet (or another computer) and then subsequently run from the local disk. The warning which is displayed when you attempt to execute a file directly from a web site is a different issue, and can only be suppressed by '​signing'​ the executable with a code signing certificate.  This article is applicable to files which have first been downloaded from the internet (or another computer) and then subsequently run from the local disk. The warning which is displayed when you attempt to execute a file directly from a web site is a different issue, and can only be suppressed by '​signing'​ the executable with a code signing certificate.
preventing_20the_20_27downloaded_20file_27_20warning.txt ยท Last modified: 2018/04/17 18:16 by tbest3112