'//////////////////////////////////////////////////////////////////////////////

' Author: SYOU

' Version 1.0

' Company: Etude Conception Informatique

' Purpose: get and set filetimestamp from ScriptEZ.dll to this script file

'//////////////////////////////////////////////////////////////////////////////

main()

 

Sub main()

 

  Dim fso, scriptez

  Set fso      = CreateObject("Scripting.FileSystemObject")

  Set scriptEZ = CreateObject("ScriptEZ.API")

 

  ScriptEZ.AppRegister

  ' get path of ScriptEZ.dll

  dllPath = ScriptEZ.GetOpenDlgDirectoryPath("uri://scriptez.dll?path")

  ' get filetimestamp of ScriptEZ.dll

  fileTimeStamp = ScriptEZ.GetFileTimeStamp( dllPath+ "ScriptEZ.dll")

  ' convert filetimestamp binary structure to Basic String (BSTR)

  fileTimeStampBSTR = ScriptEZ.BinaryToBSTR(fileTimeStamp,24)

  ' free allocated memory for filetimestamp

  r = ScriptEZ.RestoreFileTimeStamp(vbNullString,fileTimeStamp)

 

  MsgBox fileTimeStampBSTR,,"ScriptEZ.dll - file timestamp as text"

  ' convert reversely filetimestamp as Basic String to binary structure

  fileTimeStamp = ScriptEZ.BSTRToBinary(fileTimeStampBSTR)

  ' set the filetimestamp to this script file

  r = ScriptEZ.RestoreFileTimeStamp(WScript.ScriptFullName,fileTimeStamp)

  ' free allocated memory for filetimestamp

  r = ScriptEZ.RestoreFileTimeStamp(vbNullString,fileTimeStamp)

 

  MsgBox "Pause"

  Set scriptEZ = Nothing

 

End Sub