Jump to content

How To Check If File Is In Use


Recommended Posts

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.

Link to comment
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
Link to comment
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.
Link to comment
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

Link to comment
Share on other sites

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
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
 Share

  • Recently Browsing   0 members

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