# vbs script to copy file to another computer and test speed/time

Hi,
Does anyone know of a vb or similar script that i can use to copy a file from one computer to another and then report how long it took and the speed it took?

It would be great if the script would ask me the location of the computer that I want to copy the file to (example \\computer\shared_folder)

it would also be great if it could output the time it took and speed it took to a log file like C:\folder\speed_test.log
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Why not just use ROBOCOPY for this test, it gives you those type of stats.

For example, doing this:

robocopy . g:\ large.txt

I got this:

-------------------------------------------------------------------------------
ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------

Started : Wed Oct 05 17:02:33 2011

Source : c:\ee\
Dest : g:\

Files : large.txt

Options : /COPY:DAT /R:1000000 /W:30

------------------------------------------------------------------------------

1    c:\ee\
100%        New File               9.5 m        LARGE.TXT

------------------------------------------------------------------------------

Total    Copied   Skipped  Mismatch    FAILED    Extras
Dirs :         1         0         1         0         0         0
Files :         1         1         0         0         0         0
Bytes :    9.53 m    9.53 m         0         0         0         0
Times :   0:00:01   0:00:01                       0:00:00   0:00:00

Would be easy to put that in a BAT file and use PROMPT to ask for the computer name to copy to, let me know if you need help with that.

~bp
0
OwnerAuthor Commented:
if you wouldnt mind doing that, i would greatly appreciate it. I dont know much about coding.
0
OwnerAuthor Commented:
actually after looking into robocopy, that won't work for windows Server 2003 since its not part of the standard features.

is there another way of doing it?
0
Commented:
Can you download it from the resource kit and place it on the server?

~bp
0
OwnerAuthor Commented:
Ya i can do that. I bet i could setup the script so if robocopy is not installed i could download it,and then have it run the command?

what do i need to do to use the prompt feature to ask for the computer name and location?
0
Commented:
Hope this makes sense, it will prompt for the destination computer and folder path and then do the copy.  It will display the results to the screen, and also save it to a logfile.  Update the SETs at the top of the script as needed.  Save as a BAT file.

@echo off

REM Define folders and files to be used for copy and logging
set BaseDir=c:\basefolder
set TestFile=testfile.txt
set LogFile=logfile.txt

REM Prompt for computer name
set Computer=
set /P Computer=Enter computer name:

REM If a computer name was entered, do the timing test
if defined Computer (
robocopy "%BaseDir%" "%Computer%" "%TestFile%" /TEE /LOG:"%LogFile%"
)

~bp
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

OwnerAuthor Commented:
this worked perfectly!
0
Commented:
Great, glad that helped, thanks for the feedback.

~bp
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.