Jump to content

Check all drives for a file


Recommended Posts

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)
Link to comment
Share on other sites

$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

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