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 ...
1st November 2006, 11:30 PM #1
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.
Const OVERWRITE_EXISTING = True
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
IDG Tech News
2nd November 2006, 12:08 AM #2
Re: Need help to finsih script?
Use the FileExists to check for the presence of any of the files or copy over a flag.txt and check for that.
If objFSO.FileExists("file to check") Then
'File allready exists
'Copy you files here
Or you can use FolderExists to check for the existence of a folder.
By salan in forum Windows
Last Post: 8th November 2007, 07:55 PM
Last Post: 7th November 2007, 12:48 AM
By Galway in forum Windows
Last Post: 29th August 2007, 12:00 PM
By wesleyw in forum Scripts
Last Post: 5th July 2007, 02:58 PM
Last Post: 28th September 2006, 08:21 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)