Looping through files in a directory
Posted: 10 Sep 2011 01:53
Hi,
I am trying to loop through some files in a directory as such:
but I get this error: The system cannot find the file C:/Users/jackie/Desktop/test.
Can someone help me figure this out? I am trying to get to every file in the test directory, but its telling me it can't find the directory itself!!! When I change /f to /r, then it sees everything under Desktop...Can someone help?
I am trying to loop through some files in a directory as such:
@echo off
set direc=C:/Users/jackie/Desktop/test
for /f %%a IN (%direc%) do echo %%a
pause
but I get this error: The system cannot find the file C:/Users/jackie/Desktop/test.
Can someone help me figure this out? I am trying to get to every file in the test directory, but its telling me it can't find the directory itself!!! When I change /f to /r, then it sees everything under Desktop...Can someone help?