comparing files for changes

Author Message
bjpeck28

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 12/6/2011
  • Status: offline
comparing files for changes Tuesday, December 06, 2011 12:21 PM (permalink)
0
Hey guys..
 
i am fairly new to Powershell here and I am trying to write a script that will allow me to "keep an eye" on the file and then write an event in my event log telling me that something was changed to that file.  I really want to base it off of the "write time".  Is there a way to do such a thing? 
I have the commands to create the file and folder, but I just need direction on how to run the looping process. 
 
any help is appreciated..
 
thanks guys!!!
 
#1
    ebgreen

    • Total Posts : 8227
    • Scores: 98
    • Reward points : 0
    • Joined: 7/12/2005
    • Status: offline
    Re:comparing files for changes Wednesday, December 07, 2011 3:27 AM (permalink)
    0
    You could run a scheduled task to look at the last modified time of the file then compare that to the last time that the script ran. Usually for this sort of task however I use a WMI Event Sink to make a script fire whenever the file is modified.
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9