Jump to content
codingislife

Warning Message pops up and can't be closed

Recommended Posts

codingislife

Hi everyone I'm working an an installing automation project and part of what I need to do is allow the protected so files to be seen. However when I check the box under Folder Options a Warning box pops up asking me if id like to continue  which I send a "!y". This doesnt close the box. So I'Ve also tried ControlClick() and to send key strokes none of which works. Please help.

 

 

#RequireAdmin

        Run("rundll32.exe shell32.dll,Control_RunDLL Powercfg.cpl", "")
        Sleep(1000)
        WinWait("Power Options", "")
        If Not WinActive("Power Options", "") Then WinActivate("Power Options", "")
        WinWaitActive("Power Options", "")

        Send("!to")
        Sleep(750)
        If Not WinActive("Folder Options", "General") Then WinActivate("Folder Options", "General")
        WinWaitActive("Folder Options", "General")

        Send("+{TAB}"); SHIFT TAB
        Sleep(750)
        If Not WinActive("Folder Options", "General") Then WinActivate("Folder Options", "General")
        WinWaitActive("Folder Options", "General")

        Send("^{RIGHT}"); Ctrl Right Arrow
        Sleep(750)
        If Not WinActive("Folder Options", "View") Then WinActivate("Folder Options", "View")
        WinWaitActive("Folder Options", "View")

        Send("{TAB 2}"); scroll to set defaults
        Sleep(750)
        If Not WinActive("Folder Options", "View") Then WinActivate("Folder Options", "View")
        WinWaitActive("Folder Options", "View")

        Send("{DOWN 12}{SPACE}"); scroll to set defaults
        Sleep(750)
        If Not WinActive("Folder Options", "View") Then WinActivate("Folder Options", "View")
        WinWaitActive("Folder Options", "View")


        If Not WinActive("Warning", "You have chosen") Then WinActivate("Warning", "You have chosen")
        WinWaitActive("Warning", "You have chosen")
        Sleep(1000)

        ;ControlClick("Warning","","Button1")
        Send("!Y"); blocks the pop up notification
        ;Send("{LEFT}{ENTER}")

Share this post


Link to post
Share on other sites
codingislife

Didn't check spelling before. Meant to say working on an automated installation file and cant uncheck the protected os files to be seen.

Share this post


Link to post
Share on other sites
Subz

You could do that or just use registry:

RegWrite("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "REG_DWORD", 1) ;~ Select: Show hidden files, folders, or drives
RegWrite("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ShowSuperHidden", "REG_DWORD", 1) ;~ Uncheck: Hide protected operating system files (Recommended)
;~ Requires log off or restart before settings take effect however if you want to test staight away you can use the following
While ProcessExists("explorer.exe")
    ProcessClose("explorer.exe")
    ProcessWaitClose("explorer.exe")
WEnd
If @OSArch = 'x64' Then
    DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 1) ;~ Turns Off 64 Bit Redirection
        Run(@ComSpec & " /c start explorer.exe", "", @SW_HIDE)
    DllCall("kernel32.dll", "boolean", "Wow64DisableWow64FsRedirection", "boolean", 0) ;~ Turns On 64 Bit Redirection
Else
    Run(@ComSpec & " /c start explorer.exe", "", @SW_HIDE)
EndIf

 

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

×