Jump to content

Timing File Transfer


Tripredacus
 Share

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>

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

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...