Jump to content

#RequireAdmin [Solved]


 Share

Recommended Posts

The main idea is that if you launch a script on a vista+ machine with UAC, then it will prompt to give the script administrative priviliges

(using windows 7)

aha ... i put this line in s script and when i run it from the guest account it happened something strange ... in the task manager the process was opening and closing "non-stop" (google translate) and a loading circle next to the cursor was appearing and disappearing

Posted Image

[center]Sorry for my bad english. Trying my best :Dhttp://iulianonofrei.comhttp://www.last.fm/user/Revolt666 [/center]

Link to comment
Share on other sites

RequireAdmin does open a new process, but that shouldn't be happening.

Can you provide a small sample to replicate the problem?

#RequireAdmin
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=Print Screen icon.ico
#AutoIt3Wrapper_outfile=Print Screen v2.2.exe
#AutoIt3Wrapper_Res_Description=Saves a print screen made in a folder choosen by the user
#AutoIt3Wrapper_Res_Fileversion=0.0.2.2
#AutoIt3Wrapper_Run_After=C:\Users\Revolt\Documents\AutoIt\Softwares\Utility\Compiler.au3 "''Print Screen v2.2.exe''"
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <Constants.au3>
#include <Date.au3>
#include <GUIConstantsEx.au3>
#include <Misc.au3>
#include <Reclama.au3>
#include <ScreenCapture.au3>
#include <Print Screen v2.2 registry.au3>
#include <Print Screen v2.2 file.au3>

_Singleton( "Print Screen" )

If @OSArch = "X64" Then
    MsgBox( 0 , "Print Screen v2.2" , "X64 opperating systems are not supported!" )
    Exit
EndIf

TraySetToolTip( "Print Screen v2.2" )

Global $cheat = $CmdLine[ $CmdLine[ 0 ] ]

If IsAdmin() Then
    Print_Screen_v2_2_registry()
Else
    Print_Screen_v2_2_file()
EndIf

i found already the mistake ... i forgot the #requireadmin at the beginning ... i'm already checking at the end if has admin rights or not but it's strange what it does if i open it

Edited by Revolter

[center]Sorry for my bad english. Trying my best :Dhttp://iulianonofrei.comhttp://www.last.fm/user/Revolt666 [/center]

Link to comment
Share on other sites

A small pointer... When I say a small sample, that means that it will run on a standard AutoIt installation. If you give us a script we can't run then we can't help.

Heres what I used:

#RequireAdmin

If IsAdmin() Then
    MsgBox(0, 'Hello Admin', 'You are running as an administrator')
Else
    MsgBox(0, 'Hello User', 'You are not an admin')
EndIf

I then ran it on two different types of account: User and Admin.

Without UAC:

Admin: Showed 'Hello Admin' regardless of whether RequireAdmin was used.

User: Showed 'Hello User' when RequireAdmin was not used, script terminates when it was.

With UAC:

<Restarting now... I'll add the results here soon.>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...