JonF Posted September 12, 2009 Share Posted September 12, 2009 (edited) I have a situation in which there is a directory containing a whole bunch of directories, each containing files I need to copy (by writing a script file for another language). I know the entire path except the last few characters of the last directory name. These last few characters follow an underscore. I tried:; $CmdLine[1] is the path to the set of directories For $i = 0 To (UBound($DriverNames) - 1) $SearchHandle =FileFindFirstFile($CmdLine[1] & $DriverNames[$i] & "_*") If $SearchHandle Then FileWriteLine($FileHandle,"FileCopy," & $FileFindNextFile($SearchHandle) & "*.*,%Target_Win%\Inf") FileClose($SearchHandle) EndIf NextThe If test is true, but FileFindNextFile returns a null string. What am I missing? Edited September 12, 2009 by JonF Link to comment Share on other sites More sharing options...
99ojo Posted September 12, 2009 Share Posted September 12, 2009 I have a situation in which there is a directory containing a whole bunch of directories, each containing files I need to copy (by writing a script file for another language). I know the entire path except the last few characters of the last directory name. These last few characters follow an underscore. I tried: ; $CmdLine[1] is the path to the set of directories For $i = 0 To (UBound($DriverNames) - 1) $SearchHandle =FileFindFirstFile($CmdLine[1] & $DriverNames[$i] & "_*") If $SearchHandle Then FileWriteLine($FileHandle,"FileCopy," & $FileFindNextFile($SearchHandle) & "*.*,%Target_Win%\Inf") FileClose($SearchHandle) EndIf Next The If test is true, but FileFindNextFile returns a null string. What am I missing? Hi, just a: If $SearchHandle <> -1 Then ;-)) Stefan Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now