If I step through this code, it works fine.
If I run it, I get bad results.
If I run it with the Wait uncommented, I get the right results (unless the file list is going to be really large, in which case I have bad results but don't know it.)
MS doesn't have a WaitUntilPreviousCommandIsFinished
How can I tell how much delay I need here?
I don't want to put Wait>10 just to be safe.
Code: Select all
Let>FileListFile=%DESKTOP_DIR%\FileList.txt
DeleteFile>FileListFile
Let>TargetDir=c:\Users
Run>cmd /c Dir %TargetDir%\*.* /s /b >%FileListFile%
//Wait>2
ReadFile>FileListFile,FileList
Length>FileList,Lngth
MDL>Lngth