Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Copy File to users home drives if a certain file exists

Reply
 
Old 09-22-2009   #1 (permalink)
Dolfan849


 
 

Copy File to users home drives if a certain file exists

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

My System SpecsSystem Spec
Old 09-22-2009   #2 (permalink)
Pegasus [MVP]


 
 

Re: Copy File to users home drives if a certain file exists


"Dolfan849" <Dolfan849@newsgroup> wrote in message
news:9552D10D-9E03-4D7B-A2E8-2926655465E6@newsgroup
Quote:

> 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.


My System SpecsSystem Spec
Old 09-22-2009   #3 (permalink)
Dolfan849


 
 

Re: Copy File to users home drives if a certain file exists

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:
Quote:

>
> "Dolfan849" <Dolfan849@newsgroup> wrote in message
> news:9552D10D-9E03-4D7B-A2E8-2926655465E6@newsgroup
Quote:

> > 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.
>
>
>
My System SpecsSystem Spec
Old 09-23-2009   #4 (permalink)
Pegasus [MVP]


 
 

Re: Copy File to users home drives if a certain file exists

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@newsgroup> wrote in
message news:4E662FED-AD55-4E98-A591-70F234C34AB8@newsgroup>I can
copy the shortcut/files but I am not sure how to get a script to run
Quote:

> 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:
>
Quote:

>>
>> "Dolfan849" <Dolfan849@newsgroup> wrote in message
>> news:9552D10D-9E03-4D7B-A2E8-2926655465E6@newsgroup
Quote:

>> > 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.
>>
>>
>>

My System SpecsSystem Spec
Old 09-23-2009   #5 (permalink)
Dolfan849


 
 

Re: Copy File to users home drives if a certain file exists

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:
Quote:

> 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@newsgroup> wrote in
> message news:4E662FED-AD55-4E98-A591-70F234C34AB8@newsgroup>I can
> copy the shortcut/files but I am not sure how to get a script to run
Quote:

> > 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:
> >
Quote:

> >>
> >> "Dolfan849" <Dolfan849@newsgroup> wrote in message
> >> news:9552D10D-9E03-4D7B-A2E8-2926655465E6@newsgroup
> >> > 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.
> >>
> >>
> >>
>
>
>
My System SpecsSystem Spec
Old 09-23-2009   #6 (permalink)
Pegasus [MVP]


 
 

Re: Copy File to users home drives if a certain file exists

Google is your friend. When you type this into a Google search box:

download "script56.chm"

then you get around 6,000 hits. The first one is probably the one pointing
at the Microsoft site.


"Dolfan849" <Dolfan849@newsgroup> wrote in message
news:6711A8C2-4F7E-4594-87A8-C1681DB7A572@newsgroup
Quote:

> 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:
>
Quote:

>> 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@newsgroup> wrote
>> in
>> message news:4E662FED-AD55-4E98-A591-70F234C34AB8@newsgroup>I can
>> copy the shortcut/files but I am not sure how to get a script to run
Quote:

>> > 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@newsgroup> wrote in message
>> >> news:9552D10D-9E03-4D7B-A2E8-2926655465E6@newsgroup
>> >> > 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.
>> >>
>> >>
>> >>
>>
>>
>>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Access denied trying to copy file across home network Vista file management
if a file exists PowerShell
Can't copy file from Vista to Windows Home Server Vista networking & sharing
Get "file already exists" on trying to save a new file (after rena Vista General
File copy from external XP Pro HD to internal Vista Home Premium H Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46