I managed to sidestep this problem by using os.walk:
filename = 'schedule.xls'
searchdir = 'T:\Test'
for root, dirs, files in os.walk(searchdir):
if filename in files:
result = root + name
break
print result I am still interested in how the code in my last post could be fixed. Also, is there a way to specify the maximum number of subdirectories os.walk will look inside?