# Batch file directory of files in folder

by dingpud
Tags: batch, directory, file, files, folder
 Sci Advisor PF Gold P: 1,843 Batch file directory of files in folder Are you sure that the txt file is even being created in the first place? If the current directory is set to "C:\", then your command will try to create the txt file within "C:\". I use Vista and on my machine non-administrators don't have permission to create files there. The solution is to specify a place where you are allowed to write, e.g. dir /s *.* > C:\Users\InsertYourLoginNameHere\dirlist.txt or, better still dir /s *.* > %HOMEDRIVE%%HOMEPATH%\dirlist.txt which has the same effect.