' Movie Strip.iwb ' $main $include "windowssdk.inc" def version$="1.0":string autodefine "off" 'all files store the date/times in TYPE filetime DEF qwtime:UINT64 ENDTYPE TYPE systemtime,2 DEF wMillisecondsec,wSecond,wMinute,wHour,wDay,wDayofWeek,wMonth,wYear:WORD ENDTYPE TYPE WIN32_FIND_DATA,4 DEF dwFileAttributes:INT DEF ftCreationTime:FILETIME DEF ftLastAccessTime:FILETIME DEF ftLastWriteTime:FILETIME DEF nFileSizeHigh:UINT DEF nFileSizeLow:UINT DEF dwReserved0:INT DEF dwReserved1:INT DEF cFileName[MAX_PATH]:ISTRING DEF cAlternate[14]:ISTRING ENDTYPE def ofile:file def filenameo, strdrive, name, filesystemname:string DEF cnt = 0:INT DEF flags, serialnumber, maxcomponentlength:INT ' Integers of the call flags=0: serialnumber=0: maxcomponentlength=0 ' Make sure there all set to zero openconsole strdrive = "F:\\" LABEL TryAgain GetVolumeInformationA(strdrive,name,255,serialnumber,maxcomponentlength,flags,filesystemname,255) 'print "name: ", name, " serialnumber: ", serialnumber, " maxcomponentlenght: ", maxcomponentlength, 'print " filesystemname: ", filesystemname filenameo = strdrive + name + ".csv" if (openfile(ofile,filenameo,"W") <> 0) IF strdrive = "F:\\" strdrive = "G:\\" goto TryAgain ENDIF print "File: ", filenameo, " Not able to Open Output" goto Aborted endif GetSubDir(strdrive) label Aborted closefile Ofile INT fail=COPYFILE(filenameo,"C:\\Users\\Bill\\OneDrive\\Documents\\"+name+".csv",0) IF fail = 0 THEN PRINT "Copy failed ", name PRINT "Count: ", cnt, " ", name DO:UNTIL INKEY$ <> "" closeconsole END SUB GetSubDir(Path:STRING) DEF filename, temp, ext:STRING DEF dir:INT DEF filesize:UINT64 temp = Path + "*.*" dir = FINDOPEN(temp) IF (dir) WHILE (dir) filename = *dir.cFileName IF (*dir.dwFileAttributes & @FILE_DIRECTORY) IF (filename = ".") OR (filename = "..") ext = "" ELSE 'PRINT "GetSubDir ", filename GetSubDir(Path + filename + "\\") ENDIF ELSE ext = UCASE$(RIGHT$(filename,3)) IF (filename <> "") AND (ext = "MP4" OR ext = "AVI" or ext = "MKV") cnt++ filesize = *dir.nFileSizeLow + (4294967296q * *dir.nFileSizeHigh) WRITE ofile, filename + "\t" + path + "\t" + USING("%q###,###,###,###,###",filesize) + "\t" + str$((*dir.nFileSizeHigh << 32) | *dir.nFileSizeLow) ' returns -1,756,188,940, should be 2,538,778,356 ENDIF ENDIF filename = FINDNEXT(dir) IF (!*dir.cFileName[0]) FINDCLOSE(dir) dir = 0 ENDIF ENDWHILE ENDIF RETURN ENDSUB