Solved

Windows Batch Script to Search Network Drive Directorys

Posted on 2009-05-12
2
268 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Flask is a microframework for Python based on Werkzeug and Jinja 2. This requires you to have a good understanding of Python 2.7. Lets install Flask! To install Flask you can use a python repository for libraries tool called pip. Download this f…
Dictionaries contain key:value pairs. Which means a collection of tuples with an attribute name and an assigned value to it. The semicolon present in between each key and values and attribute with values are delimited with a comma.  In python we can…
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 modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

738 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