Pulled my hair out a bit, but finally got something working:

Code
alias CIM_DataFile {
  .comopen Locator WbemScripting.SWbemLocator
  if ($comerr) {
    .comclose Locator
    return
  }
  .comclose Locator $com(Locator,ConnectServer,3,dispatch* Services)
  if ($comerr) {
    .comclose Services 
    return
  }
  .comclose Services $com(Services,ExecQuery,3,bstr*,Select * from CIM_DataFile where Name = " $+ $replace($1-,\,\\) $+ ",dispatch* CIMDF)
  if ($com(CIMDF)) var %ret $comval(CIMDF,1,$prop)
  :error
  if ($com(Locator)) .comclose Locator
  if ($com(Services)) .comclose Services
  if ($com(CIMDF)) .comclose CIMDF
  return %ret
}


Code
  //echo -ag $CIM_DataFile(C:\Users\acvxq\AppData\Roaming\mIRC\mirc.ini).LastModified


Thus:
Code
alias t1 {
  var -s %file $mircdirtest.txt

  write -ca %file This is a sample message [1]
  var -s %mtime.1 $CIM_DataFile(%file).LastModified

  ; <...snip here's a lot of code...>

  write -a %file This is a sample message [2]
  var -s %mtime.2 $CIM_DataFile(%file).LastModified

  if (%mtime.2 > %mtime.1) echo -ag File ' $+ %file $+ ' has changed.
  else echo -ag File ' $+ %file $+ ' has NOT changed.
}



File has changed.

Last edited by kap; 04/04/20 07:08 PM. Reason: fixed mistake in code and added t1 back in, this time it works!

GNU Terry Pratchett - Looking for a mIRC help channel -> Check #mircscripting @ irc.swiftirc.net