Urgent!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • meenu_susi
    New Member
    • Jun 2006
    • 47

    Urgent!

    Hi

    How to monitor a folder when a new file is added to it..in vb script

    could you please send me the coding for this

    regards
    meenu
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    can you kindly post the code that you are working on.

    Comment

    • jg007
      Contributor
      • Mar 2008
      • 283

      #3
      do a google for ' filesystem watcher', the first link is for MSDN which explains filesystem watcher , if you refine that search a bit you should be able to find vbscript

      Comment

      • meenu_susi
        New Member
        • Jun 2006
        • 47

        #4
        hi
        I have used the below code

        <script type="text/vbscript">
        sFolder = "C:\new"
        Set oFSO = CreateObject("S cripting.FileSy stemObject")
        Set nFiles = oFSO.GetFolder( sFolder).Files
        document.write "No of Files --------- " & nFiles.count
        </script>

        and its working fine for getting the no of files in a folder..

        And for example i am having 2 files in C:\new and when a customer put one more files into that c:\new means i want to get the latest file count and at the same time i want to extract the newly entered file name in one variable .


        Can u help me out to do this...

        thanks in advance
        meenu

        Comment

        • jg007
          Contributor
          • Mar 2008
          • 283

          #5
          sorry but you do need to try and work some of this out yourself first, from a brief google the filesystem watcher is available as vb net but might not be for vbscript although I have seem some WMI examples to do a similar thing, you could also poll the folder every so often and check for files with a file creation date newer than a specific time although this might not work very well

          please try and use google and put together some code then we can help you if it does not work but at the moment all the code you have shown does is check for the current files within a folder

          Comment

          Working...