Sign in to follow this  
Followers 0
sonicxtacy02

How To Check If File Is In Use

5 posts in this topic

First post but i've been using autoit for about a year

I'm wondering if there is a way to check if a file is in use by windows or another program. More specifically, i want to be able to see if a jpeg is being displayed. Here is my script (v3b)

While ProcessExists("rr.exe")
If ProcessExists("iguidance.exe") Then
    Run("C:\Program Files\Road Runner\skins\MC2.5\exec.exe LOADIMG;170;127;205;200;600.jpg;OUT")
ENDif
WEnd

as is it keeps loading the image (600.jpg). I need to see if the image is already loaded.

Share this post


Link to post
Share on other sites



First post but i've been using autoit for about a year

I'm wondering if there is a way to check if a file is in use by windows or another program. More specifically, i want to be able to see if a jpeg is being displayed. Here is my script (v3b)

While ProcessExists("rr.exe")
If ProcessExists("iguidance.exe") Then
    Run("C:\Program Files\Road Runner\skins\MC2.5\exec.exe LOADIMG;170;127;205;200;600.jpg;OUT")
ENDif
WEnd

as is it keeps loading the image (600.jpg). I need to see if the image is already loaded.

just had the while loop always running, got to but a stop to it :)

While 1
If ProcessExists("iguidance.exe") then
      If not ProcessExists("exec.exe") then;<==i am just assuming this is the process run when JPG img is displayed, correct me if i'm wrong.
Run("C:\Program Files\Road Runner\skins\MC2.5\exec.exe LOADIMG;170;127;205;200;600.jpg;OUT")
Endif
Endif
Wend

Share this post


Link to post
Share on other sites

just had the while loop always running, got to but a stop to it :)

While 1
If ProcessExists("iguidance.exe") then
      If not ProcessExists("exec.exe") then;<==i am just assuming this is the process run when JPG img is displayed, correct me if i'm wrong.
Run("C:\Program Files\Road Runner\skins\MC2.5\exec.exe LOADIMG;170;127;205;200;600.jpg;OUT")
Endif
Endif
Wend
That doesnt help. The run command is still run every second or so lagging the whole system til the script is killed.

Share this post


Link to post
Share on other sites

That doesnt help. The run command is still run every second or so lagging the whole system til the script is killed.

then try this

While 1
If ProcessExists("iguidance.exe") then
      If not Winexists(600.jpg) then
Run("C:\Program Files\Road Runner\skins\MC2.5\exec.exe LOADIMG;170;127;205;200;600.jpg;OUT")
Endif
Endif
Wend

If this doesn't help any, tell me how the picture is displayed

ie. is it in it's own window? is it in a gui? can i have the window title?

For this info try "autoit 3 window info" found wherever you installed AutoIt

these scripts are just stabs in the dark, a little more info would help

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

why are you checking if doesnt exist why not just do a Else

While 1
If ProcessExists("iguidance.exe") then
    MsgBox(0,"O JEEZ","OMG THE FREAKING PROCESS IS RUNNING YOUR GOING TO GET HAXOREDED")
Else
Run("C:\Program Files\Road Runner\skins\MC2.5\exec.exe"); WTF IWas with that Loading;170 BS theres no such extension as that?
Endif
Wend

or if you really really want to check if its not there when theres absolutely no point if your checking if it is there and yeah

While 1
If ProcessExists("iguidance.exe") then
    MsgBox(0,"O JEEZ","OMG THE FREAKING PROCESS IS RUNNING YOUR GOING TO GET HAXOREDED")
Elseif Not ProcessExists("iguidance.exe") then
Run("C:\Program Files\Road Runner\skins\MC2.5\exec.exe"); WTF IWas with that Loading;170 BS theres no such extension as that?
Endif
Wend
Edited by thatsgreat2345

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  
Followers 0