Hey all,
We are using the following script to performance monitor some SharePoint servers:
Code:
Option Explicit
Dim oFSO, oWN
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oWN = CreateObject("WScript.Network")
'// This makes sure the drive is not there
If Not oFSO.DriveExists("Z:") Then
'// Map the drive
oWN.MapNetworkDrive "Z:", "\\servername\GAS\uk\it_pub"
Else
End If
Dim olddate, nowdate
olddate = Now
'// Copying the file to the folder this script is stored in
oFSO.CopyFile "z:\downloadtest\test2.pdf", Replace(WScript.ScriptFullName,WScript.ScriptName,""), true
nowdate = Now
Msgbox "Time taken to copy the 10MB file was " & DateDiff("s", olddate, nowdate) & " seconds"
oFSO.deleteFile Replace(WScript.ScriptFullName,WScript.ScriptName,"") & "\test2.pdf"
'// Clean up
oWN.RemoveNetworkDrive "Z:"
Set oWN = Nothing
Set oFSO = Nothing
Set olddate = Nothing
Set nowdate = Nothing
The first run of this code returns around 300seconds (which is what I'd expect) but the second run completes in about 6 seconds! Now I assume it is caching somewhere but does anyone know how to turn this off?
Thanks,
Leon