Jump to content

Open File - Security Warning


JERRYG
 Share

Recommended Posts

I am using AUTOIT to start an install of a .msi file using the command 'ShellExecuteWAIT("Photorepappsetup.msi").... The install starts by giving a window with the title 'Open File - Security Warning'--- I think this window is comming from Windoes xp and not the .msi file. I cannot get the script to respond to this window.... Does anyone have an advice????? Thanks.....

Link to comment
Share on other sites

  • 3 years later...

AdLib()

AdLibEnable()

AdLibDisable()

ShellExecute()

All In the helpfile...

every function...has a example...

I've got the same problem (Security warning dialog preventing further execution). I've tried using AdlibRegister (code shown below), with no success - the thing just sits there haunting me. Can anyone help me to retain what little hair I have left?

if FileExists("C:\SLP-V Install Files\SLP-V3.05.msi") Then

AdlibRegister("_WinTitle")

ShellExecuteWait("C:\SLP-V Install Files\SLP-V3.05.msi")

AdlibUnRegister("_WinTitle")

Exit

EndIf

Func _WinTitle()

If WinActive('Open File - Security Warning') Then

ControlClick('Open File - Security Warning',"","&Run")

EndIf

EndFunc

Link to comment
Share on other sites

I think I've seen this before and requires DEP to be disabled. If you google that you will easily find how to disable it.

People will be reluctant to help with disableing security measures via script. I'm with them, this is a setting that an administrator of computer should make the decision to manually disable.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

  • 11 months later...

I think I'm a little late regarding the solution. However I post it for further reference.

The solution is very simple, just add a file type assostion in the policies registry.

regwrite("HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesAssociations", "LowRiskFileTypes", "Reg_SZ", ".pif; .exe; .bat; .zip; .rar")

You can add more file type as long as you separate then with ";".

However, I do recomend to delete the file type assostion due security issues

regdelete("HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesAssociations")

Link to comment
Share on other sites

In the article of this nice NirSoft tool AlternateStreamView v1.32 is the following paragraph:

"About Alternate Streams in NTFS File System

NTFS system has a feature that allows you to add multiple streams in addition to the main file stream. When you open or view the file, only the main file stream is visible, while other additional streams are hidden from the user.

Here's 3 examples of alternate streams usage in Windows operating system:

[*]Favorites of Internet Explorer: When You add a Web site link into your 'Favorites', a .url file containing the url and description is created. However, if the Web site also have an icon (favicon), the icon is saved as alternate stream for the same url file. The stream name of the icon is :favicon:$DATA

[*]Downloaded files of Internet Explorer: When you download and save a file with Internet Explorer, it automatically add a zone information for the saved file. This zone information is used for identifying the file as downloaded file from the Internet. The stream name in this case is :Zone.Identifier:$DATA

[*]Summary information of files: When you right-click on a file in Explorer and go to the 'Summary' tab, you can add summary information for the file, like title, subject, author, and so on. This summary information is also saved into alternate stream. The stream name in this case is SummaryInformation:$DATA.",

Esp. see bullet two.

Searching for some info on streams I've found this article:

http://www.flexhex.com/docs/articles/alternate-streams.phtml

I've tried FileDelete() and @comspec del, which didn't work out, but _WinAPI_DeleteFile() from Yashied's excellent works fine and removes the stream without a problem.

_WinAPI_DeleteFile(@ScriptDir & "test.exe:Zone.Identifier")

Func _WinAPI_DeleteFile($sFile)
    Local $Ret = DllCall('kernel32.dll', 'int', 'DeleteFileW', 'wstr', $sFile)
    If (@error) Or (Not $Ret[0]) Then
        Return SetError(1, 0, 0)
    EndIf
    Return 1
EndFunc   ;==>_WinAPI_DeleteFile
Edited by KaFu
Link to comment
Share on other sites

I've tried FileDelete() and @comspec del, which didn't work out, but _WinAPI_DeleteFile() from Yashied's excellent works fine and removes the stream without a problem.

_WinAPI_DeleteFile(@ScriptDir & "test.exe:Zone.Identifier")
...

Thanks for sharing!!

Works fine.

My MP3 files downloaded from web executed from file manager invoke Window's alert messagebox.

With this script I can remove it :);)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...