Code:
alias sn { 
  var %a = a $+ $ticks, %b = b $+ $ticks, %result
  .comopen %a wbemscripting.swbemlocator
  if (!$comerr) {
    .comclose %a $com(%a,connectserver,3,dispatch* %b)
    if (!$comerr) {
      .comclose %b $com(%b,execquery,3,bstr,select serialnumber from win32_operatingsystem,dispatch* %a)
      if (!$comerr) {
        %result = $sha1($comval(%a,1,serialnumber))
        .comclose %a
      }
    }
  }
  return %result
}


What this code does is return a SHA-1 hash of your operating system's serial number. So you could do something like this:

Code:
on *:start:{
  if ($sn != %thispc) {
    %thispc = $v1
    ; execute code for first run...
  }
}


The only problem is that it's not very portable. I believe any windows version older than XP comes without WMI installed by default. To do any better you'll probably need a dll.