× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 04-Dec-2013 11:10 -0800, Jeff Crosby wrote:
C:\Windows\System32\Forfiles.exe
-p "C:\inetpub\ftproot\SystemiJrnRcvrs"
-c "cmd /c del @FILE" -d -%AgeLimit% -m MASTER*

Note that the full path is in there.

If I run the batch file directly in a command window or just
double-click it in Windows explorer, it runs fine. If I try to run it
from the task scheduler (either by the time trigger or right-click
and Run) it failswith opcode 2.

Should that be "Error Code 2"? A web search for an error code 2 yielded what possibly are some good topics to review. One suggests using @PATH@FILE instead of just @FILE. Another suggests that a problem will remain if the path or file name has embedded blanks, so the double quote delimiter must be included; shown un-escaped in the -c switch so like:
"cmd /c del "@PATH@FILE""

My web search:
<https://www.google.com/search?&q="forfiles"+"error+2"+OR+"error+code+2";>


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.