+ Post New Thread
Results 1 to 2 of 2
Scripts Thread, Need help to finsih script? in Coding and Web Development; I have the following script below. What it odes is copy all the contents of a folder on the network ...
  1. #1
    tosca925's Avatar
    Join Date
    Aug 2005
    Thank Post
    Thanked 4 Times in 4 Posts
    Rep Power

    Need help to finsih script?

    I have the following script below. What it odes is copy all the contents of a folder on the network to a designated folder on the client. I want to run this on a OU which contains 25 PC's so it copies the files across to the folder. What i need help with is......once the files are copied over on log in on day one I do not want them to be copied over every time the computer is restarted. Is there a way i can stop this so that the files are only copied once and the script checks this and then stops. I know i could leave it in the OU for a couple of days but what happens if i have to re-image a machine and the script is no longer in the OU?

    here is what i have so far and it does work as far as copying the contents of one folder to another.

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("Wscript.Shell")
    ' global variables
    source = "\\pcname\data\engl\*.*"
    dest = "c:\Program Files\myprogram\data\eng"
    objFSO.CopyFile source, dest, OVERWRITE_EXISTING
    If Err = 0 Then

    End If

  2. #2

    plexer's Avatar
    Join Date
    Dec 2005
    Thank Post
    Thanked 1,715 Times in 1,526 Posts
    Rep Power

    Re: Need help to finsih script?

    If objFSO.FileExists("file to check") Then
    'File allready exists
    'Copy you files here
    End If
    Use the FileExists to check for the presence of any of the files or copy over a flag.txt and check for that.

    Or you can use FolderExists to check for the existence of a folder.


+ Post New Thread

Similar Threads

  1. Help with KIX script please
    By salan in forum Windows
    Replies: 8
    Last Post: 8th November 2007, 07:55 PM
  2. Best script ever!
    By Zabu in forum Scripts
    Replies: 0
    Last Post: 7th November 2007, 12:48 AM
  3. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 12:00 PM
  4. Does anyone have a script...
    By wesleyw in forum Scripts
    Replies: 4
    Last Post: 5th July 2007, 02:58 PM
  5. AUP Script thats not quite good enough
    By Pear in forum Scripts
    Replies: 8
    Last Post: 28th September 2006, 08:21 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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