Jump to content
Sign in to follow this  
bourboncrow

Check all drives for a file

Recommended Posts

bourboncrow

This is a batch file version of the code but i wonder how it can be done in autoit? im pretty new to autoit and i tried google but i didnt find anything so i assume im useless at google + autoit

thanks in advance

FOR %%i IN (Z Y X W V U T S R Q P O N M L K J I H G F E D C) DO IF EXIST "%%i:\1234.txt" (SET TEST=%%i)

Share this post


Link to post
Share on other sites
jdelaney

Helpfile: DriveGetDrive

Returns an array, loop through with a For...To...Step...Next (also in help file)


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
bourboncrow

Thanks

Share this post


Link to post
Share on other sites
bourboncrow

$a = DriveGetDrive('ALL')
For $i = 1 To $a[0]
    If FileExists($a[$i] & 'win8.install.txt') Then
        $installdrive = $a[$i]
MsgBox(0, 'Message', $installdrive)
        ExitLoop
    EndIf
Next
If $i > $a[0] Then MsgBox(0, 'Message', 'File not found')

Heres the code if someone needs it

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  

×