Search the Community
Showing results for tags 'filefindfirstfile'.
-
Hello. I need to list only the folders that has a name composed of numbers only. How do I do this? OBS: I just posted the relevant content to the folder. Global $path = "G:\jobs\" For $i = 1 To $aArray[0] Local $search = FileFindFirstFile($path & $aArray[$i] & "\[0-9]" ) I tried with "\*.*" and it returns me the expected result, but the other doesn't.
-
So I tried to get the first file of a folder with FileFindFirstFile but it always gives me a 1 as a value, so it tells me that the folder is empty. But the folder is not empty. Code: Local $path_times_text_01 = "D:\xxx\test\xxx\" Local $search = FileFindFirstFile($path_times_text_01 & "*.*") Timecheck() Func Timecheck() ConsoleWrite($search & @CRLF) If $search = -1 Then MsgBox(0, "Error", "could not find extension") Exit EndIf If $search = 1 Then MsgBox(0, "Fehler", "folder is empty") Exit EndIf ConsoleWrite($search & @CRLF) EndFuncThis does not make any sense to make because again the folders are not empty.
- 5 replies
-
- file
- filefindfirstfile
-
(and 2 more)
Tagged with:
-
The program is supposed to search for *.pst files, then copy the results to a server share. What am I doing wrong? It doesn't seem to be doing anything. $nMsg = GUIGetMsg() Switch $nmsg Case $bckuppst While 1 $pst1=FileFindFirstFile("*.pst") FileCopy($pst1, "\\majordc01\backups\" & @UserName, 8) $pst2=FileFindNextFile($pst1) FileCopy($pst2, "\\majordc01\backups\" & @UserName, 8) if @error then ExitLoop WEnd EndSwitch Thanks!
- 5 replies
-
- FileFindFirstFile
- find
-
(and 1 more)
Tagged with:
-
Hello, Wondering if anyone has experienced unreliable returns from FileFindFirstFile. I have a script running from a WinPE environment that maps a network share then checks to see if the expected number of files with the same name pattern exist. The function below is called with "p:sharefile00*.bin", 10 There are exactly 10 files in the share named file001.bin, file002.bin... up to file0010.bin. The first time, the funtion immediately returns -1, but if I call it repeatedly with the exact same parameter values, it finally works. Func _VerifySpan($fpath, $fcount) $fc = 0 $fh = FileFindFirstFile($fpath) If $fh = -1 Then Return False ; First file not found While 1 $fn = FileFindNextFile($fh) If @error = 1 Then ExitLoop $fc = $fc + 1 WEnd FileClose($fh) If $fcount = $fc Then Return True Else Return False EndFunc