graysky Posted December 14, 2006 Share Posted December 14, 2006 I'd like to test out my new network gear without using a stopwatch. Is there an easy way to literally time how long it takes to copy files from one location to another and when finished, report the total time via a batch file?Thanks! Link to comment Share on other sites More sharing options...
eyeball Posted December 14, 2006 Share Posted December 14, 2006 if you type in a batch filetime /Tand then run the batch file from command line outputting to a text file with > C:\test.txt i think this will do it Link to comment Share on other sites More sharing options...
graysky Posted December 14, 2006 Author Share Posted December 14, 2006 time /Tcopy VTS_01_0.IFO y:\ > output.txt??time /T doesn't seems to work Link to comment Share on other sites More sharing options...
eyeball Posted December 14, 2006 Share Posted December 14, 2006 (edited) i made this batch file..time /Txcopy "C:\test.txt" "d:" /ytime /Tand dragged it into a command window and typed > c:\output.txt after it. in the output.txt text file it told me what time it started and what time it finished. so it does work but it doesnt tell you in seconds, only minutes Edited December 14, 2006 by eyeball Link to comment Share on other sites More sharing options...
graysky Posted December 14, 2006 Author Share Posted December 14, 2006 (edited) OK.. I get it... yeah I need seconds. Too bad windows doesn't work like LINUX does... if I do the following in LINUX:$ time cp file /copy/toIt copies the file and reports the time it took to copy the file in three formats where "real" is the actual time it took to copy the file:real 0m0.695suser 0m0.004ssys 0m0.260s Edited December 14, 2006 by graysky Link to comment Share on other sites More sharing options...
eyeball Posted December 14, 2006 Share Posted December 14, 2006 thats awesome, too bad windows cant do seconds oh well, unless there is a third party time app somewhere that could help? Link to comment Share on other sites More sharing options...
cluberti Posted December 14, 2006 Share Posted December 14, 2006 Robocopy can do this.http://www.ss64.com/nt/robocopy.htmlOutput:------------------------------------------------------------------------------ ROBOCOPY :: Robust File Copy for Windows------------------------------------------------------------------------------ Started : Thu Dec 14 17:25:16 2006 Source : C:\Users\User\AppData\Local\Temp\ Dest : F:\ Files : bigfile.iso Options : /COPY:DAT /R:1000000 /W:30------------------------------------------------------------------------------ 1 C:\Users\User\AppData\Local\Temp\100% New File 1.4 g bigfile.iso------------------------------------------------------------------------------ Total Copied Skipped Mismatch FAILED Extras Dirs : 1 0 1 0 0 0 Files : 1 1 0 0 0 0 Bytes : 1.456 g 1.456 g 0 0 0 0 Times : 0:01:45 0:01:45 0:00:00 0:00:00 Speed : 14782954 Bytes/sec. Speed : 845.887 MegaBytes/min. Link to comment Share on other sites More sharing options...
Super-Magician Posted December 15, 2006 Share Posted December 15, 2006 There's a section in HFSLIP that will do this.I have only the relevant sections posted below. You may copy and modify it to suit your needs. All credit goes to Tomcat76, who wrote the code for it.Paste before copy section:TIMECALCFOR /F "TOKENS=2,3 DELIMS=:. " %%Q IN ('ECHO %TIME%') DO SET ETIMEM=%%Q&SET ETIMES=%%RIF NOT "%STIMEM%"=="00" IF %STIMEM% LSS 10 FOR /F "TOKENS=1 DELIMS=0" %%I IN ('ECHO %STIMEM%') DO SET STIMEM=%%IIF NOT "%STIMES%"=="00" IF %STIMES% LSS 10 FOR /F "TOKENS=1 DELIMS=0" %%I IN ('ECHO %STIMES%') DO SET STIMES=%%IIF NOT "%ETIMEM%"=="00" IF %ETIMEM% LSS 10 FOR /F "TOKENS=1 DELIMS=0" %%I IN ('ECHO %ETIMEM%') DO SET ETIMEM=%%IIF NOT "%ETIMES%"=="00" IF %ETIMES% LSS 10 FOR /F "TOKENS=1 DELIMS=0" %%I IN ('ECHO %ETIMES%') DO SET ETIMES=%%ISET /A TMIN=%ETIMEM%-%STIMEM%SET /A TSEC=%ETIMES%-%STIMES%ECHO>TTEST.TXT %TSEC%FOR /F %%I IN ('FINDSTR/R "\-" TTEST.TXT') DO SET SERROR=1IF DEFINED SERROR CALL :NSTIMESECHO>TTEST.TXT %TMIN%FOR /F %%I IN ('FINDSTR/R "\-" TTEST.TXT') DO SET MERROR=1DEL/Q/F TTEST.TXTIF DEFINED SERROR (SET NSTIMEM=59) ELSE (SET NSTIMEM=60)IF DEFINED MERROR CALL :NSTIMEMIF %TSEC% LSS 10 SET TSEC=0%TSEC%SET RTIMELN=Total run time: %TMIN% min %TSEC% secECHO.ECHO %HFTOT% hotfixes processed. %RTIMELN%ECHO.GOTO EOF:NSTIMESSET /A NSTIMES=60-%STIMES%SET /A TSEC=%NSTIMES%+%ETIMES%SET /A TMIN=%TMIN%-1GOTO EOF:NSTIMEMSET /A NSTIMEM=%NSTIMEM%-%STIMEM%SET /A TMIN=%NSTIMEM%+%ETIMEM%GOTO EOF Link to comment Share on other sites More sharing options...
graysky Posted December 15, 2006 Author Share Posted December 15, 2006 (edited) @super-m: thanks but robocopy does it all and it pretty simple to use.@cluberti: robocopy is great... totally does what I want. Thanks!robocopy is actually part of the Windows Server 2003 Resource Kit Tools which is a free d/l. Edited December 15, 2006 by graysky Link to comment Share on other sites More sharing options...
cluberti Posted December 15, 2006 Share Posted December 15, 2006 np - glad I could help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now