Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2011-10-05
8
Medium Priority
?
442 Views
Last Modified: 2012-08-13
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
0
Comment
Question by:Brad Nelson
  • 4
  • 4
8 Comments
 
LVL 59

Expert Comment

by:Bill Prew
ID: 36920830
Why not just use ROBOCOPY for this test, it gives you those type of stats.

For example, doing this:

robocopy . g:\ large.txt

Open in new window

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

Open in new window

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
 

Author Comment

by:Brad Nelson
ID: 36920959
if you wouldnt mind doing that, i would greatly appreciate it. I dont know much about coding.
0
 

Author Comment

by:Brad Nelson
ID: 36920976
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 59

Expert Comment

by:Bill Prew
ID: 36920993
Can you download it from the resource kit and place it on the server?

~bp
0
 

Author Comment

by:Brad Nelson
ID: 36921014
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
 
LVL 59

Accepted Solution

by:
Bill Prew earned 2000 total points
ID: 36921645
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%"
)

Open in new window

~bp
0
 

Author Closing Comment

by:Brad Nelson
ID: 37001824
this worked perfectly!
0
 
LVL 59

Expert Comment

by:Bill Prew
ID: 37002073
Great, glad that helped, thanks for the feedback.

~bp
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Loops Section Overview

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question