option explicit
Dim wmi,os,value,wsh,sha,sfo
Set sfo=CreateObject("Scripting.FileSystemObject")

do while WScript.Arguments.Count=0 and WScript.Version>=5.7

  'Check if Vista
  Set wmi = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
  Set os = wmi.ExecQuery ("SELECT * FROM Win32_OperatingSystem")
  For Each value in os
    if left(value.Version,3)<6.0 then exit do 'Exit if not Vista
  Next

  'Run this script as admin.
  Set sha=CreateObject("Shell.Application")
  sha.ShellExecute "wscript.exe",""""+WScript.ScriptFullName+""" vista","","runas"

  WScript.Quit
loop

'Current directory may be moved to system32, maybe not.
Set wsh=CreateObject("WScript.Shell")
wsh.run "regsvr32.exe """+sfo.GetAbsolutePathName(WScript.ScriptFullName & "\..\dlls\" & "oyagame.dll")+""""
