How to close windows activation popup?

Discussion in 'Scripting' started by timesurfer, Nov 6, 2013.

  1. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    Anyone know how to close this windows activation window via .bat/.vbs code?

    Thanks

    :shisha:
     

    Attached Files:

    • WA.PNG
      WA.PNG
      File size:
      49.6 KB
      Views:
      72
  2. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,770
    1,101
    60
    #2 Mr Jinje, Nov 6, 2013
    Last edited by a moderator: Apr 20, 2017
    I'd try it like this with powershell, but it would be shorter script to just use VBS directly.

    Code:
    [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic');[Microsoft.VisualBasic.Interaction]::AppActivate("Windows Activation")
    Start-Sleep 2
    [void][System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms');[System.Windows.Forms.SendKeys]::SendWait("%{F4}")
    VBS is actually easier than powershell in this particular instance.

    http://www.google.com/search?as_qdr...s=org.mozilla:en-US:official&client=firefox-a

    Code:
    Set WshShell = WScript.CreateObject("WScript.Shell")
    WshShell.AppActivate "Windows Activation"
    WshShell.SendKeys "%{F4}"
    or even Auto-It

    Code:
    WinWaitActive ("Windows Activation")
    Sleep (2000)
    send ("!{F4}")
    Exit
     
  3. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #3 timesurfer, Nov 6, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Thank you Mr Jinje

    I'm not sure how I want to implement this yet but the .vbs should work fine

    I have just also made my concept for personalization window close after theme install better after some testing so I shall after that see if I can put this code into use

    May the force be with you :yoda:
     
  4. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #4 timesurfer, Nov 7, 2013
    Last edited: Nov 7, 2013
    (OP)
    Hmm, going to try .vbs code for closing windows activation window :sith:

    Do not try, only do :yoda:...lol

    Not sure where to put it except at the very beginning of IR7.bat but wonder if it will work anywhere?!

    Actually if your in notifications from a restart, explorer or task bar doesn't even open yet but you can see the non-genuine watermark then if you wait for a few minutes the activation window self-closes and explorer and task bar open and then the rearm part of IR7.bat runs cause the watermark disappears which means it rearmed then finally the theme is restored, and personalization window closes

    So my guess it that tasks won't run till explorer runs so can I put in in registry as run once at onstart/onlogon?

    Any ideas how or when to implement the windows activation window?
     
  5. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    895
    482
    30
    taskkill /f /im slui.exe
     
  6. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #6 timesurfer, Nov 9, 2013
    Last edited: Nov 10, 2013
    (OP)
    I kinda want to explore how to get these popups to not popup or where in registry they sit and what triggers them?

    Everyone said all the things I did in RW couldn't be done and I did them anyway so maybe I can eliminate these popups too...

    [​IMG]

    Here's the "victim of piracy one" below as attachment :eek:...lol
     

    Attached Files:

  7. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #8 timesurfer, Nov 10, 2013
    Last edited: Nov 10, 2013
    (OP)
    Would totally love to kill the process or ban it from opening all together :sith:...lol

    Gosh, I'd like to keep the desktop from going black and watermark from ever appearing

    :starwars:
     
  8. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,770
    1,101
    60
    #9 Mr Jinje, Nov 10, 2013
    Last edited by a moderator: Apr 20, 2017
    OK, been playing around with SLUI.exe, seems is easy to spot when it opens. Using the unmodified sample from the second link I was able to get a notification almost immediately after launching slui.exe (code running in Powershell ISE + launching SLUI.exe from a different cmd.exe window)

    Code:
    Clear-Host
    $Start = get-date
    Write-Host "Waiting for a new process to be created ... 
    You will be notified within 10 seconds of  process  creation
     start time was $Start"
    
    $Query = "select * from __instanceCreationEvent within 10 
              where targetInstance isa 'win32_Process'"
    $Eventwatcher = New-Object management.managementEventWatcher $Query
    
    $Event = $Eventwatcher.waitForNextEvent()
    $Event.targetInstance | 
    Format-List -property [a-z]*
    
    Results
    Code:
    Waiting for a new process to be created ... 
    You will be notified within 10 seconds of  process  creation
     start time was 11/09/2013 21:15:38
    
    
    Caption                    : slui.exe
    CommandLine                : "C:\Windows\system32\slui.exe"
    CreationClassName          : Win32_Process
    CreationDate               : 20131109211541.622943-360
    CSCreationClassName        : Win32_ComputerSystem
    Description                : slui.exe
    ExecutablePath             : C:\Windows\system32\slui.exe
    Name                       : slui.exe
    OSCreationClassName        : Win32_OperatingSystem
    OSName                     : Microsoft Windows 7 Ultimate |C:\Windows|\Device\Harddisk1\Partition1
    
    and to kill the process.
    Code:
    Get-Process slui | ForEach-Object -Process {Stop-Process -Id $_.ID}
    It'd take work to convert all that to VBS, and probably needs an if statement to prevent it from running against other processes, but it can be done.

    Script for creating/running a scheduled task based on a WMI event.

    http://blog.start-automating.com/?Post=Creating a scheduled task from a WMI event

    http://www.networkautomation.com/urc/blog/launch-process-automation-with-wmi-trigger/4df021f85ee65/

    http://www.ravichaganti.com/blog/?p=1820
     
  9. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #10 timesurfer, Nov 11, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Great work Mr. Jinje, unfortunately it is too hard for me to understand what is happening and how to put into RW but it a great idea :worthy:

    When I used this

    Code:
    taskkill /f /im slui.exe 
    it said PID 3476

    Thanks for all your efforts

    :shisha:
     
  10. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #11 timesurfer, Nov 11, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    I'm wondering if this will work :eek:...lol

    I mean a task has to wait till explorer starts and there is no task bar when explorer hasn't started

    I guess this has timing to do with it meaning the taskkill has to be behind the slui.exe!?

    I guess if it's valid then I could do it like this with Hybrid3 task

    Code:
    schtasks /create /tn "Hybrid3" /tr "taskkill /f /im slui.exe" /sc onlogon /ru ""
     
  11. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,770
    1,101
    60
    #12 Mr Jinje, Nov 11, 2013
    Last edited by a moderator: Apr 20, 2017
    Try running this VBS at start up and it will close the slui.exe process within 1 second of opening and then respawn itself to run in background for the next nag. Delete the echo line if you must.

    KungFuSlui.vbs
    http://technet.microsoft.com/library/ee198937.aspx
     
  12. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #13 timesurfer, Nov 11, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Totally works instantly :eek:

    Actually a task does not have to wait for slui.exe popup to get out of the way by closing and task does close slui.exe before explorer/desktop/task bar is opened

    The timing is perfect and task runs before slui.exe both in startup and logon

    Hybrid3 task works perfect and I guess I could combine running IR7.vbs and killtask in Hybrid2 task but it works so I'll leave it be :shisha:...lol

    Code:
    schtasks /create /tn "Hybrid3" /tr "taskkill /f /im slui.exe" /sc onlogon /ru ""
    Funny how this is the first thing I had idea to do 4 years ago and the last thing I did in Rearm Wizard Phase 4.2 (RWP4.2)

    Thanks for that WMI which also works but the task is so easy and happens instantly upon restart/logon, I think I'll go with it for now

    Question is this popup that rarely/randomly happens also slui.exe?

    http://forums.mydigitallife.net/attachment.php?attachmentid=25148&d=1384011000

    Thanks for all your help :yoda:
     
  13. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,770
    1,101
    60
    #14 Mr Jinje, Nov 12, 2013
    Last edited: Nov 12, 2013
    Gotcha, Does the hybrid3 schtask run repeatedly or only once at login ? As for if it is or not slui.exe in disguise, I do not know, but if it is...

    The VBS is self replicating and runs continuously (in theory). So if that little nag window is actually SLUI.exe with a different App.Title, then the WMI VBS is going to find both of these windows and end them, followed by waiting for the next nag. If ran at startup (machine startup, not user login) it could run in the background killing slui before explorer loads (in theory).

    Is there a setting in schtasks to make a task wait for something specific to happen ?
     
  14. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    The great thing about WMI creating more complicated tasks is that there are very
    few limits as to how it will wait and sit like troll under bridge waiting for slui.exe "travelers" to end their "process" lives :eek:

    I looked for slui.exe when the second smaller nags regarding "victim of piracy" and did not see it so maybe it is under different process name?

    I'm up for using your kung fu code

    My experience with my task is that is always closed slui.exe and sometimes it took a second but never saw slui.exe sit there and not get closed!

    So the second nag still needs to be resolved

    @MJ

    Did you see the dism thread I started aimed at a response from you

    It was cool when MD and I we're using a software (forget the name but it allowed control over another's computer?) it would do all the RE stuff but took like 10 minutes to mount RE image with entries pre-programmed into it then restart

    It was fun and totally automatic but MD and I ditched it cause it took too long :suicide:...lol

    With a little help I will try your fung fu code but don't know how to invoke the second piracy nag :(

    :yoda: Thanks
     
  15. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    #16 timesurfer, Nov 24, 2013
    Last edited: Nov 24, 2013
    (OP)
    Did some research on the random piracy popup

    http://www.askvg.com/genuine-windows-7-became-pirated-make-it-original-and-activated-again/

    My goal is to use one task to deal with this and slui.exe and I'm in consideration of using your kung fu code

    Also my IR7.vbs can also accommodate kung fu/slui.exe and this all in one so I could conceivably eliminate Hybrid3 task

    Also2 the above link mentions the network service that blocks WPA key delete inside of windows so I wonder if it's not such an inconceivable task to reset rearms to 5 without reboot or need to use DISM?

    Thank you for your help MJ :sith:
     
  16. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,770
    1,101
    60
    #17 Mr Jinje, Nov 24, 2013
    Last edited: Nov 24, 2013
    Don't forget to delete this one, most users won't appreciate the pop-up. EDIT :::: Should probably also switch to cscript, the sample I stole was wscript and I never changed it.

    Wscript.Echo "This is my Kung-Fu and it is strong!"

    Also, might want to double check how I am re-spawning, it might be going synchronously (meaning a wscript.exe opens a second wscript.exe and both stay in memory), have to re-think the line needed to asynch that from VBS.

    jshell.Run "KungFuSlui.vbs",0,true
     
  17. timesurfer

    timesurfer MDL Developer

    Nov 22, 2009
    8,527
    4,112
    270
    :worthy: :yoda:
     
  18. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,770
    1,101
    60
    #19 Mr Jinje, Nov 24, 2013
    Last edited by a moderator: Apr 20, 2017
    Try this.

    jshell.Run "KungFuSlui.vbs",0,false

    Code:
    strComputer = "."
    Set objSWbemServices = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!" & "\\" & strComputer & "\root\cimv2")
    Set objEventSource = objSWbemServices.ExecNotificationQuery( "SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Process' AND TargetInstance.Name = 'slui.exe'")
    Set objEventObject = objEventSource.NextEvent()
    set jshell = createobject("WScript.Shell")
    jshell.Run "taskkill /f /im slui.exe",0,true
    jshell.Run "KungFuSlui.vbs",0,false
    EDIT: Removed unnecessary " &" concatenation from SQL Statement.

    Not sure if needed, but could add line to stop the service before taskkill. (unknown if slui.exe is called from sppsvc or from ???, but if sppsvc easy fix)

    jshell.Run "net stop sppsvc",0,true

     
  19. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,770
    1,101
    60
    #20 Mr Jinje, Dec 1, 2013
    Last edited: Dec 1, 2013
    Noticed this at the askvg link. Apparently we have to reboot for it to apply, wise it might be to create a logoff or shutdown task to apply it before every reboot. Plus it's a one-liner from powershell and about 100 lines in VBS.