Results 1 to 2 of 2

Thread: vb script

  1. #1
    Join Date
    Mar 2003

    Unanswered: vb script

    i am trying to create a vb script for a application that will copy and move files from one drive to another. The script will move a file from the source folder to the target folder if it if older than one week. I have the script to find the date. i am just having trouble with searchign the folder and loops. heres the date code and suggestions:
    function fnInit(){
    //date created
    var oCreated=new Date(document.fileCreatedDate);
    //Todays date
    var oToday=new Date();
    //There are 86400000 milliseconds in a day
    var iMilliSeconds=86400000;
    var iDaysBetween=(oToday.getTime() - oCreated.getTime()) / iMilliSeconds;
    alert("Created: " + oCreated + "\nDays since created: " +
    If idaysbetween > 6 CopyTo ("e:\group_1\app1")


  2. #2
    Join Date
    Mar 2003
    Atlanta, GA

    FSO to the rescue...

    You need to use the VB FileSystemObject.

    I suggest you download a copy of the VBScript Language Reference from the microsoft site, and take a look at the FSO chapter.

    It has TONS of examples showing how to do what you want to do.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts