Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

forfiles help

Status
Not open for further replies.

flotsam

MIS
Mar 16, 2004
12
US
I am trying to use the forfiles command to create a report of files older than x days, that reside on my file server.

I have the following:

Code:
forfiles -s -py:\ -m*.* -d-365 -c"cmd /c echo @FDATE @FSIZE @PATH\@FILE" | sort /O C:\filereports\365daysold.txt

The above runs perfectly as it is. The drive listed is not my file server, it is another mapped drive that I was using for testing. To run this against my file server it would look like the following:

Code:
forfiles -s -pu:\ -m*.* -d-365 -c"cmd /c echo @FDATE @FSIZE @PATH\@FILE" | sort /O C:\filereports\365daysold.txt

The problem is that when I try and run it on this drive, I get the following output:

-snip
19941216 4896 u:\ACCPAY\PAGENET.XLS
19941220 3300 u:\ACCPAY\PARKWAY.XLS
FindNextFile - unexpected return code=6 (on FindNext) line 317
Warning : Access denied (during recursion) line 302
Warning : Access denied (on FindFirst) line 274
-EOF

I get the same error if I run the command logged into windows as myself, or the domain admin, remote (drive map), or locally on the server.

Yet I have no problem running a simple dir /s command either logged in under my user accout, or the domain admin.

Can anyone tell me where I screwed up?

Thanks, Chad
 
I just wanted to say thanks for all of your input.

I decided to create a batch file to run this against all of the various directories that I needed to, instead of continuing the search for a complete solution, due to time constraints. Not elegant, but it is effective.

Thanks again,
Chad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top