From: ed on
Hi all,

windows 2003 SP2 server

I just need to find out that new pdf files have been added to one directory
ex:123 and sub directories every 15 days.

Can anyone help me with the script?

Thank you.

From: Pegasus [MVP] on


"ed" <ed(a)discussions.microsoft.com> wrote in message
news:2EDEE976-93D1-4557-87E7-7EC2E0B1AC20(a)microsoft.com...
> Hi all,
>
> windows 2003 SP2 server
>
> I just need to find out that new pdf files have been added to one
> directory
> ex:123 and sub directories every 15 days.
>
> Can anyone help me with the script?
>
> Thank you.
>

If you need a VB Script solution then let's have a look at what you've got
so far. If you prefer a turn-key solution then you could use this
ready-to-use command:

robocopy d:\temp d:\test *.pdf /s /L /MaxAge:15

From: "Steven Cheng" on
Hi Ed,

If you want to perform the file monitoring in directory at a certain
frequency or period, you can use the FileSystemObject to manually loop all
the files (in target directory) and compare with older list(store in a file
or other place) and execute the script through a task schedule.

#OBJECT: FileSystemObject
http://www.devguru.com/technologies/vbscript/quickref/filesystemobject.html

http://msdn.microsoft.com/en-us/library/2z9ffy99(VS.85).aspx

There are also WMI event which can let you register directory/file creation
even so that whenever there is new file created, you can get notification
immediately:

#Monitor folder for creation of file
http://gallery.technet.microsoft.com/ScriptCenter/en-us/a4cf7d0b-7635-4166-8
53c-4249aaec2a6e

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg(a)microsoft.com.


--------------------
>From: =?Utf-8?B?ZWQ=?= <ed(a)discussions.microsoft.com>
>Subject: help with the script
>Date: Tue, 30 Mar 2010 11:53:01 -0700

>
>Hi all,
>
>windows 2003 SP2 server
>
>I just need to find out that new pdf files have been added to one directory
>ex:123 and sub directories every 15 days.
>
>Can anyone help me with the script?
>
>Thank you.
>
>