'Verify we working with Win 7. I think Vista fits here also
Str1 = Reg_Read(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName")
If InStr(Str1, "Windows 7") Then
Str1 = Reg_Read(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", MyAppPath & "YOURAPP.exe")
If Str1 <> "# RUNASADMIN" Then
Reg_Write HKEY_CURRENT_USER, "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", MyAppPath & "YOURAPP.exe", "# RUNASADMIN", REG_SZ
Reg_Write HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers", MyAppPath & "YOURAPP.exe.exe", "# RUNASADMIN", REG_SZ
End If
End If