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 - simple file copy problem

Reply
 
Old 08-24-2009   #1 (permalink)
wuzzle


 
 

simple file copy problem

I can't see what I am doing wrong. I modified this script that I
found on MS web site. All files are in the same directory.

Const ForReading = 1
Const OverwriteExisting = TRUE


Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Scripts\Computers.txt")


Do Until objFile.AtEndOfStream
strComputer = objFile.ReadLine
strRemoteFile = "\\" & strComputer & "\C$\windows
\system32\winexit.scr"
objFSO.CopyFile "C:\Program Files\Windows Resource Kits\Tools
\winexit.scr", strRemoteFile, OverwriteExisting
Loop

My System SpecsSystem Spec
Old 08-25-2009   #2 (permalink)
wuzzle


 
 

Re: simple file copy problem

On Aug 24, 5:55*pm, wuzzle <wuzz...@xxxxxx> wrote:
Quote:

> I can't see what I am doing wrong. *I modified this script that I
> found on MS web site. *All files are in the same directory.
>
> Const ForReading = 1
> Const OverwriteExisting = TRUE
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set objFile = objFSO.OpenTextFile("C:\Scripts\Computers.txt")
>
> Do Until objFile.AtEndOfStream
> * * strComputer = objFile.ReadLine
> * * strRemoteFile = "\\" & strComputer & "\C$\windows
> \system32\winexit.scr"
> * * objFSO.CopyFile "C:\Program Files\Windows Resource Kits\Tools
> \winexit.scr", strRemoteFile, OverwriteExisting
> Loop
I figured it out. Some of the machines I was trying to copy files to
were either sleeping or off.
My System SpecsSystem Spec
Old 08-26-2009   #3 (permalink)
Corey Thomas


 
 

Re: simple file copy problem

On Aug 25, 1:54*pm, wuzzle <wuzz...@xxxxxx> wrote:
Quote:

> On Aug 24, 5:55*pm, wuzzle <wuzz...@xxxxxx> wrote:
>
>
>
>
>
Quote:

> > I can't see what I am doing wrong. *I modified this script that I
> > found on MS web site. *All files are in the same directory.
>
Quote:

> > Const ForReading = 1
> > Const OverwriteExisting = TRUE
>
Quote:

> > Set objFSO = CreateObject("Scripting.FileSystemObject")
> > Set objFile = objFSO.OpenTextFile("C:\Scripts\Computers.txt")
>
Quote:

> > Do Until objFile.AtEndOfStream
> > * * strComputer = objFile.ReadLine
> > * * strRemoteFile = "\\" & strComputer & "\C$\windows
> > \system32\winexit.scr"
> > * * objFSO.CopyFile "C:\Program Files\Windows Resource Kits\Tools
> > \winexit.scr", strRemoteFile, OverwriteExisting
> > Loop
>
> I figured it out. *Some of the machines I was trying to copy files to
> were either sleeping or off.
Yeah, you should ping the machine before you try to do any operation
on it. Will speed up your script and give you better logging
options.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
UAC FAR file copy problem Vista General
Problem with file copy over Gb LAN from Vista x64 to XP x86... Network & Sharing
Simple? How to copy WWW picture to C drive VB Script
Can't simple copy from a Mac to my ext HD General Discussion
No need to burn a DVD, simple ISO file problem solution. Vista General


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