Jump to content
Sign in to follow this  

Timing File Transfer

Recommended Posts


I'm not too active here much anymore, but I figured I'd post this. In the process of troubleshooting one of our servers, I was given the task of determining the length of time it took to copy a file to the server from a client. I wrote this up real quick and it worked perfectly. It also works in Vista. I am sure there are better ways of doing this tho.

#include <EventLog.au3>

RunWait( @ComSpec & " /c xcopy test.wim z:\legacy" )

Func _Start()
    Local $hEventLog, $aData[4]=[3, 1, 2, 3]

    $hEventLog = _EventLog__Open("", "Application")
    _EventLog__Report($hEventLog, 4, 0, 2, "Administrator", "Testing File Copy has started", $aData)
    _EventLog__Close ($hEventLog)

EndFunc  ;==>_Start

Func _Finish()
    Local $hEventLog, $aData[4]=[3, 1, 2, 3]

    $hEventLog = _EventLog__Open("", "Application")
    _EventLog__Report($hEventLog, 4, 0, 2, "Administrator", "Testing File Copy has completed", $aData)
    _EventLog__Close ($hEventLog)

EndFunc  ;==>_Finish

edit: changed from code to autoit tags.

Edited by Tripredacus

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.