Jump to content

WinKill and WinSetState not working before Winows Login


Recommended Posts

I have a script which works fine when run after I log-in to my Windows 10 computer but does not work if run from the Startup folder prior to log-in.

Here's a stripped down example called "OnWSJT.au3":

Run ( "C:\WSJT\wsjtx\bin\wsjtx.exe")
WinKill ( "WSJT-X - Wide Graph" )
WinSetState ( "WSJT-X   v", "", @SW_MINIMIZE )

I've used the Autoit Build tool to create OnWSJT.exe and am using  OnWSJT.exe for testing.

When wsjt.exe starts it opens two windows with titles that start with the strings shown in the WinKill and WinSetState calls.

OnWSJT.exe functions as expected if I have logged in and run it from the Desktop.

I need this to run when the computer first turns on so I put a shortcut to OnWSJT.exe in the Windows Startup folder.

Then I execute a Power Restart and log-in.  Both windows are on the Desktop  - the Run call worked but the WinKill and WinSetState calls have not been effective.

What could be causing this and how can I get around it?

Thank you - Dick




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

  • Recently Browsing   0 members

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