Jump to content
Sign in to follow this  
peanutym

If window isnt open then open it script

Recommended Posts

peanutym

First off thanks for reading, i have searched a bit for this and i cant seem to find a script that is as simple as this in the searching. what i am needing is just a script that will see if a window is open if not then Run the file to get it open.

basically just doing a constant loop to be sure that the windows is running. I want to add a exit key but i have found that script already with HotKeySet command so i can do that. But the commands im finding right now are like WinActive and WinActivate which isnt waht i want. i dont need the window to be active and i dont want it to be just want it to be open and running.

any direction with this is appreicated.

Share this post


Link to post
Share on other sites
peanutym

Welcome peanutym,

Some functions you may need are

While 1
    If Not WinExists() Then
        Run()
    EndIf
    Sleep()
WEnd

Missing some parameters of course. You will want a condition with your HotKeySet.

:D

no that helps a ton. thats what i wanted thank you.

Share this post


Link to post
Share on other sites
peanutym

no that helps a ton. thats what i wanted thank you.

so that worked just like i wanted but iw as wondering the run syntax?

i know that its

Run("c:\runme.exe", "" ,"")

what what is the 2nd and 3rd set for? is that a start in section? cuase i think i need that for mine. the loop you gave me works fine and it calls the correct exe and runs it but im missing some config files in that same dirrectory and i think its due to the start in isnt there.

Edit: NM i tried it and it seems to be. everything is working thanks!

Edited by peanutym

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.