Files not showing from directories

The following code is what I have and when ran it shows 1246 files however when I use *. in the search folder area on the drive I saw they are 5,936 files. How can I fix this? Thanks

def walk_error(error):
        print(error.filename)
    
    for root, dirs, files in os.walk(r'D:/', onerror=walk_error):
        for name in files:
            tst2.append(name)
            nm.append(name) # Get Name of File
            r.append(os.path.join(root, name))  # Get path way of file
    
            created =(os.path.getctime(os.path.join(root, name))) #get creation date of file
            p.append(time.ctime(created)) #Add format date of file to list
    
            split_tup = os.path.splitext(os.path.join(root, name)) # Seperate into two tuples
            su.append(split_tup) #append tuples to list
    
            file_name = split_tup[0] # Get file name without extension
            fn.append(file_name) #Add file name with out extenion to list

        file_extension = split_tup[1] # Get file extension
        fe.append(file_extension) # Add extension to list
       

    for i in range(1, len(files)):
        a = sheet.cell(row=1+i,column =1)
        a.value = i

        b = sheet.cell(row=1+i,column =2)
        b.value = nm[i]

        c = sheet.cell(row=1+i, column = 3)
        c.value = fe[i]

        d = sheet.cell(row=1+i, column = 4)
        d.value = p[i]
    
        e = sheet.cell(row=1+i,column =5)
        e.value = '=HYPERLINK("{}", "{}")'.format(r[i],'Link to file completed how can I get Created by properties?')