Solved

Windows Batch Script to Search Network Drive Directorys

Posted on 2009-05-12
2
271 Views
Last Modified: 2012-05-06
I need to run a script which will delete files/directorys within a subfolder structure only if certain directorys exist.  Then delete the files/directorys which are older that a)7 days.

Parent directory (p:\*fund*\) could be any directory name, for example:
p:\abc\letters\reject\
p:\def\letters\printed\
p:\ghi\letters\

So in above scenario, need to search the root directory (p:\*.*\letters\) for directorys called either reject or printed, then if exist delete the file contents of reject or printed if those files are > than 7 days old.

I've been investigating the CLI in XP and don't think the 'For' or 'If' combined with 'Forfiles' commands can do this.  Do I need to look at a more powerful scripting language?

Any help would be apprciated!!

Thanks in advance.
0
Comment
Question by:Rich55555
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
Jonah11 earned 250 total points
ID: 24370645
This is probably possible, but fwiw I think windows batch is a really unintuitive and un-userfriendly scripting language.  I would look into autoIt or AHK for tasks like these, or even WSH (which can be used with both VB and Javascript, if you happen to know those).  All of these are easy to learn and much more powerful than windows batch.
0
 

Author Closing Comment

by:Rich55555
ID: 31580799
Jonah, that gives me something to work with which I wasn't aware existed so thanks for the lead!!!
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question