× 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.



Hello,

Has anyone created a Iseries batch pgm to delete all files prior to 10 days from a given directory in windows.

Personally, I'd just write a Windows program for this sort of thing instead of trying to do it from the iSeries. There'd be a lot less that could go wrong in that scenario, but whatever makes you happy, I guess.


Having said that, one way to do it from the iSeries would be with a QShell command like the following one:

  find /QNTC/MyPC/MyShare/MyDir -type f -mtime +10 | xargs rm

You can put this in a CL program or whatever by putting it in the CMD parameter to the STRQSH command. For example:

  STRQSH CMD('find . . . ')

You'll want to test/experiment with it to make sure it does exactly what you want. I recommend backing up the appropriate sections of the PC before experimenting. :)

Note that this tip uses Windows networking support to access the PC. It won't work unless the PC's directory is addressible to the iSeries via Windows Networking, and the user signed on to the iSeries needs to have appropriate authority on the Windows box.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.