Jump to content
Sign in to follow this  
lxxl

FileExists wait for drive connect

Recommended Posts

lxxl

Hello hello

who can help me to write basic scrit to to job like this :

check FileExists on drive R:\test.tx

if not wait to connect drive R:

after found file do some code

i dont have idea how to put it in loop ...

Many thx for help

lxxl

Edited by lxxl

Share this post


Link to post
Share on other sites
herewasplato

Welcome to the forum.

Do
    Sleep(99)
Until FileExists(.....
;other code here

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
LarryDalooza

You could loop DriveStatus() also...

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites
lxxl

Welcome to the forum.

Do
    Sleep(99)
Until FileExists(.....
;other code here

ha its great :)) and very easy =]]

many thx mate

lxxl

Share this post


Link to post
Share on other sites
lxxl

ahh and one more. its possible to add some extra stop marker to skip DO and go to other section when 20 times try or 1 minute pass

Do
    Sleep(99)
Until FileExists("w:\")

lxxl

Share this post


Link to post
Share on other sites
lxxl

ha always help file help ;DD

Do
    Sleep(99)
Until FileExists("w:\")
$try = $try + 1
If $try = 100 Then ExitLoop

Share this post


Link to post
Share on other sites
herewasplato

Do
    Sleep(99)
    $try = $try + 1
    If $try = 100 Then ExitLoop
Until FileExists("w:\")oÝ÷ ÚÚºÚ"µÍÜ    ÌÍÚHHHÈLÛY
NJBY[Q^ÝÊ ][ÝÝÎÌLÉ][ÝÊH[^]ÛÜ^


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
Recce

Sorry to reopen this old topic.

But what is the longest time this loop will wait?

Do
    Sleep(99)
    $try = $try + 1
    If $try = 100 Then ExitLoop
Until FileExists("w:\")

The loop is made by herewasplato from the post above.

Thank you!

Share this post


Link to post
Share on other sites
ChromeFan

Sorry to reopen this old topic.

But what is the longest time this loop will wait?

Do
    Sleep(99)
    $try = $try + 1
    If $try = 100 Then ExitLoop
Until FileExists("w:\")

The loop is made by herewasplato from the post above.

Thank you!

it will wait until the path really exists.

Website: www.cerescode.comForum: www.forum.cerescode.comIRC: irc.freenode.net , Channel: #Ceres--------------------Autoit Wrappers, Great additions to your script (Must See) (By: Valuater)Read It Befor Asking Question Click Here...--------------------Join Monoceres's Forums http://www.monoceres.se--------------------There are three kinds of people: Those who make things happen, those who watch things happen, and those who ask, ‘What happened?’” –Casey Stengel

Share this post


Link to post
Share on other sites
Recce

Then what is the difference to this:

Do
    Sleep(99)
Until FileExists(.....
;other code here

?

I am new to scripting...

:)

Edited by Recce

Share this post


Link to post
Share on other sites
ChromeFan

Then what is the difference to this:

Do
    Sleep(99)
Until FileExists(.....
;other code hereoÝ÷ ئì-¢Ç+bªê-{¥È^rKaz­ëÞ¯/}Ã"$rݱú+ë,r®±¨¦êé¢Ç¬Êjv¥²h)¶¬jëh×6Do
    ;Sleep(0)
Until FileExists(.....

but it will use much process usage.


Website: www.cerescode.comForum: www.forum.cerescode.comIRC: irc.freenode.net , Channel: #Ceres--------------------Autoit Wrappers, Great additions to your script (Must See) (By: Valuater)Read It Befor Asking Question Click Here...--------------------Join Monoceres's Forums http://www.monoceres.se--------------------There are three kinds of people: Those who make things happen, those who watch things happen, and those who ask, ‘What happened?’” –Casey Stengel

Share this post


Link to post
Share on other sites
ProgAndy

$try=0
Do
    Sleep(99)
    $try = $try + 1
    If $try = 100 Then ExitLoop
Until FileExists("w:\")

This code from herewasplato waits ~ 100*100 ms -> 10 seconds :)


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
herewasplato

$try=0
Do
    Sleep(99)
    $try = $try + 1
    If $try = 100 Then ExitLoop
Until FileExists("w:\")

This code from herewasplato waits ~ 100*100 ms -> 10 seconds :)

Correct :-)

...but just to be clear, that code was a modification of what lxxl posted.

I am not a big fan of using counters like $try = $try + 1 when a For/Next loop will work.

See my post above for the For/Next version that I would use instead.


[size="1"][font="Arial"].[u].[/u][/font][/size]

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  

×