From: Dolfan849 on
Can anyone hlep me creating a VBSCRIPT that will go folders on a network
drive and copy a file (shortcut, .lnk file) to that directory? Any help
would be greatly appreciated.

thnx,
tm
From: Pegasus [MVP] on

"Dolfan849" <Dolfan849(a)discussions.microsoft.com> wrote in message
news:9552D10D-9E03-4D7B-A2E8-2926655465E6(a)microsoft.com...
> Can anyone hlep me creating a VBSCRIPT that will go folders on a network
> drive and copy a file (shortcut, .lnk file) to that directory? Any help
> would be greatly appreciated.
>
> thnx,
> tm

Did you have a look at the CopyFile method of the File System Object? You
can see the full details, including an example, in the help file
script56.chm, which you can download from the Microsoft site. Alternatively
you might want to create a batch file and use the "copy" command.


From: Dolfan849 on
I can copy the shortcut/files but I am not sure how to get a script to run
through all the files to check if a certain file is there before I copy it.
Do you have the link for the copyfile method? Thanks for your help.

tm

"Pegasus [MVP]" wrote:

>
> "Dolfan849" <Dolfan849(a)discussions.microsoft.com> wrote in message
> news:9552D10D-9E03-4D7B-A2E8-2926655465E6(a)microsoft.com...
> > Can anyone hlep me creating a VBSCRIPT that will go folders on a network
> > drive and copy a file (shortcut, .lnk file) to that directory? Any help
> > would be greatly appreciated.
> >
> > thnx,
> > tm
>
> Did you have a look at the CopyFile method of the File System Object? You
> can see the full details, including an example, in the help file
> script56.chm, which you can download from the Microsoft site. Alternatively
> you might want to create a batch file and use the "copy" command.
>
>
>
From: Pegasus [MVP] on
Here are the examples you're after, copied straight from
script56.chm:Function ReportFileStatus(filespec)
Dim fso, msg
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(filespec)) Then
msg = filespec & " exists."
Else
msg = filespec & " doesn't exist."
End If
ReportFileStatus = msg
End FunctionFileSystemObject.CopyFile "c:\mydocuments\letters\*.doc",
"c:\tempfolder\""Dolfan849" <Dolfan849(a)discussions.microsoft.com> wrote in
message news:4E662FED-AD55-4E98-A591-70F234C34AB8(a)microsoft.com...>I can
copy the shortcut/files but I am not sure how to get a script to run
> through all the files to check if a certain file is there before I copy
> it.
> Do you have the link for the copyfile method? Thanks for your help.
>
> tm
>
> "Pegasus [MVP]" wrote:
>
>>
>> "Dolfan849" <Dolfan849(a)discussions.microsoft.com> wrote in message
>> news:9552D10D-9E03-4D7B-A2E8-2926655465E6(a)microsoft.com...
>> > Can anyone hlep me creating a VBSCRIPT that will go folders on a
>> > network
>> > drive and copy a file (shortcut, .lnk file) to that directory? Any
>> > help
>> > would be greatly appreciated.
>> >
>> > thnx,
>> > tm
>>
>> Did you have a look at the CopyFile method of the File System Object? You
>> can see the full details, including an example, in the help file
>> script56.chm, which you can download from the Microsoft site.
>> Alternatively
>> you might want to create a batch file and use the "copy" command.
>>
>>
>>


From: Dolfan849 on
No to ask a dumb question, where is script56 located? I wasn't sure where
the example scripts are listed.

thnx,
tm

"Pegasus [MVP]" wrote:

> Here are the examples you're after, copied straight from
> script56.chm:Function ReportFileStatus(filespec)
> Dim fso, msg
> Set fso = CreateObject("Scripting.FileSystemObject")
> If (fso.FileExists(filespec)) Then
> msg = filespec & " exists."
> Else
> msg = filespec & " doesn't exist."
> End If
> ReportFileStatus = msg
> End FunctionFileSystemObject.CopyFile "c:\mydocuments\letters\*.doc",
> "c:\tempfolder\""Dolfan849" <Dolfan849(a)discussions.microsoft.com> wrote in
> message news:4E662FED-AD55-4E98-A591-70F234C34AB8(a)microsoft.com...>I can
> copy the shortcut/files but I am not sure how to get a script to run
> > through all the files to check if a certain file is there before I copy
> > it.
> > Do you have the link for the copyfile method? Thanks for your help.
> >
> > tm
> >
> > "Pegasus [MVP]" wrote:
> >
> >>
> >> "Dolfan849" <Dolfan849(a)discussions.microsoft.com> wrote in message
> >> news:9552D10D-9E03-4D7B-A2E8-2926655465E6(a)microsoft.com...
> >> > Can anyone hlep me creating a VBSCRIPT that will go folders on a
> >> > network
> >> > drive and copy a file (shortcut, .lnk file) to that directory? Any
> >> > help
> >> > would be greatly appreciated.
> >> >
> >> > thnx,
> >> > tm
> >>
> >> Did you have a look at the CopyFile method of the File System Object? You
> >> can see the full details, including an example, in the help file
> >> script56.chm, which you can download from the Microsoft site.
> >> Alternatively
> >> you might want to create a batch file and use the "copy" command.
> >>
> >>
> >>
>
>
>