Sign in to follow this  
Followers 0
ahha

How do you determine when #RequireAdmin is needed?

27 posts in this topic

I have a general question. Is it possible to tell under program control when #RequireAdmin is needed?

Specifically I can WinMove the Date and Time window without #RequireAdmin, however I cannot WinMove the System Properties window without using the #RequireAdmin.

This script shows the issue.

;#RequireAdmin ;<-- makes A BIG difference
#AutoIt3Wrapper_run_debug_mode=Y ; use this to debug in console window <--- LOOK
Opt("WinTitleMatchMode", -2) ;nocase partial match okay

;MoveIt($pgm, $pgm_title)

MoveIt("notepad.exe", "notepad") ;works
MoveIt("cmd.exe", "cmd") ;works
MoveIt("control timedate.cpl", "Date and Time") ;works
MoveIt("systempropertiesprotection.exe", "System Properties") ;FAILS - handles correct, Winclose fails, etc. - actually hangs next run command - manually close window after MsgBox winclose pops up - then it will continue correctly
MoveIt("control timedate.cpl", "Date and Time") ;works
MoveIt("control sysdm.cpl", "System Properties") ;try old version - FAILS ALSO

;??? Is there some special approach needed to move a System Properties box ??? YES YES YES IT REQUIRES #RequireAdmin !!!!!

Exit


Func MoveIt($pgm, $pgm_title)
Send("#r") ;open run box
;wait for it
WinWait("Run") ;partial match
If Not WinActive("Run") Then WinActivate("Run")
WinWaitActive("Run")

Send($pgm & @CRLF) ;run program
WinWait($pgm_title) ;partial match
If Not WinActive($pgm_title) Then WinActivate($pgm_title)
WinWaitActive($pgm_title)

MsgBox(0,"Debug","Ready to move.")
$hl = WinMove($pgm_title, "", 0, 0)
MsgBox(0,"Debug","Should be at 0,0 and handle = " & $hl & " (0=not found)")
$hl = WinMove($pgm_title, "", 100, 100, Default, Default, 100) ;move slowly keep current size
MsgBox(0,"Debug","Should be at 100,100 and handle = " & $hl & " (0=not found)")

MsgBox(0,"Debug","Move completed.")
$r = WinClose($pgm_title) ;be polite and close it
MsgBox(0, "Debug", "WinClose return value = " & $r)
EndFunc

Share this post


Link to post
Share on other sites



IsAdmin maybe?


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

If you can determine the process from which the window belongs, you might get the desired results by testing if that executable process requires administrator rights.

for vista and above you could use _IsElevationRequired()


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
guinness - IsAdmin only shows if the current user is admin or not. I'm trying to determine if a program requires admin to run or not. I'll try JohnOne's suggestion and let everyone know.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

JohnOne results are as follows for your program (win 8 pro x64)

Running as admin - Notepad = 0, Regedit = 0 ;so it does not seem to distinguish when run in admin

Running NOT as admin - Notepad = 0, Regedit = 1 ;so it DOES distinguish when not run in admin

Thanks for the code. I'll try and incorporate it (giving credit).

I'm still a little puzzled by admin/no admin because although in my program it requires admin to use Winmove to move the System Properties window, I DON'T need admin privileges if I simply use my mouse to move it (i.e user NOT in admin). That is, I can move the System Properties window without the OS popping up the UAC window. This is why I was initially confused because the admin requirement does not seem to be imposed on a person (not in admin mode) using the mouse, but rather only on AutoIt the programming language. Thus I was surprised by this inconsistency in "security".

Edited by ahha

Share this post


Link to post
Share on other sites

Ah yes, The function only tells if an executable requires elevation to be ran, so if you are admin, you require no elevation.

Your other query is security, and seems valid to me, it's so a lower privileged app cannot interfere with it I imagine, probably wont be able to close the window either.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Does it write to the registry outside of HKEY_CURRENT_USER? Needs admin

Does it write to the file system outside of %Userprofile%? Needs admin

Does it run any system application this has a shield icon on it? Needs admin

On windows 7 and 8 they made it so that certain system applications with the shield are silently elevated to avoid annoying the user - but only when run manually by the user. But if run with a script you need to handle it if you are using "Run". I think running the program with ShellExecute will bring up the UAC prompt if the exe is manifested correctly.

Share this post


Link to post
Share on other sites

JohnOne - you're exactly correct - "is elevation required". Once I learn to read it will help :) You are correct the window cannot be closed under program control (without elevating to admin).

Jon - very interesting.

The challenge I have is that JohnOne's _IsElevationRequired() is limited to checking ".exe" files and I have no idea how to check Jon's listed criteria to know if a window is going to do one of the operations that needs admin. Additionally, I'm not sure how a ".cpl" control can be checked in advance (like timedate.cpl and sysadm.cpl).

So, the challenge is knowing when a program will not be able to manipulate a window that may have been started without admin, like System Properties that as Jon notes can be run manually by a user but not under program control.

Here's my attempt at it - crude as it is with examples to test (key is can you move the window).

;#RequireAdmin ;can toggle so see that "System Properties" correctly runs at Admin level
#AutoIt3Wrapper_run_debug_mode=Y ; use this to debug in console window <--- LOOK

Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

;v1a - if you can't move the window you need to run as Admin to control it

;Example 1 - check notepad.exe
$pgm = "notepad.exe"
$pgm_title = "Notepad"
Send("#r") ;open run box
;wait for it
WinWait("Run") ;partial match
If Not WinActive("Run") Then WinActivate("Run")
WinWaitActive("Run")
Send($pgm & @CRLF) ;run program
WinWait($pgm_title) ;partial match

$r = _check_window_move($pgm_title)
MsgBox(0, "Debug -1=not found, 0=OK, 1=need admin", $pgm_title & " - result = " & $r)

;Example 2 - check non-existent file (for correct reporting)
$pgm_title = "This window does not exist"
$r = _check_window_move($pgm_title)
MsgBox(0, "Debug -1=not found, 0=OK, 1=need admin", $pgm_title & " - result = " & $r)

;Example 3 - check Run box
$pgm_title = "Run"
Send("#r") ;open run box
;wait for it
WinWait("Run") ;partial match
If Not WinActive("Run") Then WinActivate("Run")
WinWaitActive("Run")

$r = _check_window_move($pgm_title)
MsgBox(0, "Debug -1=not found, 0=OK, 1=need admin", $pgm_title & " - result = " & $r)

;Example 4 - check .cpl date/time
$pgm = "control timedate.cpl"
$pgm_title = "Date and Time"
Send("#r") ;open run box
;wait for it
WinWait("Run") ;partial match
If Not WinActive("Run") Then WinActivate("Run")
WinWaitActive("Run")
Send($pgm & @CRLF) ;run program
WinWait($pgm_title) ;partial match

$r = _check_window_move($pgm_title)
MsgBox(0, "Debug -1=not found, 0=OK, 1=need admin", $pgm_title & " - result = " & $r)

;Example 5 - check .cpl System Properties - old version
$pgm = "control sysdm.cpl"
$pgm_title = "System Properties"
Send("#r") ;open run box
;wait for it
WinWait("Run") ;partial match
If Not WinActive("Run") Then WinActivate("Run")
WinWaitActive("Run")
Send($pgm & @CRLF) ;run program
WinWait($pgm_title) ;partial match

$r = _check_window_move($pgm_title)
MsgBox(0, "Debug -1=not found, 0=OK, 1=need admin", $pgm_title & " - result = " & $r)

Exit




Func _check_window_move($title) ;returns -1 if window not found, 0 if can move it, 1 can't move it - probably need to run as admin
Local $pos1, $pos2
$pos1 = WinGetPos($title) ;get current coordinates, [0] = X position, [1] = Y position, [2] = Width, [3] = Height
If ($pos1 = 0 AND @error = 1) Then Return -1 ;indicate window not found
WinMove($title, "", $pos1[0], $pos1[1]+1) ;move window quickly only one pixel. Do it vertically as human lower res in vertical.
;WinMove($title, "", $pos1[0], $pos1[1]+100, Default, Default, 100) ;DEBUG - slow to see
$pos2 = WinGetPos($title) ;get current coordinates, [0] = X position, [1] = Y position, [2] = Width, [3] = Height
WinMove($title, "", $pos1[0], $pos1[1]) ;quickly move it back
;WinMove($title, "", $pos1[0], $pos1[1], Default, Default, 100) ;DEBUG - slow to see
;now let's check to see if we were able to move it
If $pos1[1] = $pos2[1] Then
Return 1 ;can't move it
Else
Return 0 ;can move it
EndIf
EndFunc

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

To get the pid of the window handle, I would start with _WinAPI_GetWindowThreadProcessId, from there you can get the name and path of the process.

EDIT: perhaps used in serial with _WinAPI_GetModuleFileNameEx. (WinApiEx.au3)

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Just as an FYI in case it wasn't considered. #RequireAdmin isn't something that can be used conditionally, in other words, regardless of where you have it in your script it will always be processed at the start of the script. So, either the whole script has to ran under admin credentials or the whole script has to be ran under the user's credentials. You can't use an If statement, as an example, to determine whether to elevate the script with #RequireAdmin.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

All #requireadmin does is to rerun the script with ShellExecute and the runas verb. It just does it in a clever way. But I still don't understand this thread. The script writer knows what processes they are using so why try and determine it programmatically? If you look at certain windows operations they do exactly the same. For example run Disk Cleanup. It runs as a user until you click System Files. At that point it reruns itself with admin rights.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

JohnOne - I'll give those a try to find what .exe file corresponds to a cpl.

BrewManNH - understood. It's like a compiler directive of sorts and from Jon's explanation the script reruns itself with ShellExecute and the runas verb.

Jon - "The script writer knows what processes they are using so why try and determine it programmatically?" Not exactly always the case. Let me give you an actual example. I'm not at admin level. I turn on Au3Recorder because I want to generate a script to automate generating a restore point. I move to lower left and right click to bring up commands (because Send("#x") does not work - but that's another issue). Left click on run and type in (or send) "systempropertiesprotection.exe" then click OK. Up pops System Properties and I proceed to click Create, etc. I then stop the script and try running it. It doesn't work for all the reasons above. I need to either run everything at admin level (ugh) or somehow determine programmatically when I need to elevate. That's it.

In this example the user could type in any program name or control to run so we really don't know in advance.

Edited by ahha

Share this post


Link to post
Share on other sites

JohnOne - okay this shows my ignorance :( . I have the window handle, I have the PID, I even have the TreadID, however _WinAPI_GetModuleFileNameEx ( $hProcess [, $hModule] ) wants the "$hProcess - Handle to the process that contains the module." I've set $hModule to 0 so it should return the executable file of the process. How do I get the handle to the process?

;
;#RequireAdmin ;can toggle so see that "System Properties" correctly runs at Admin level
#AutoIt3Wrapper_run_debug_mode=Y ; use this to debug in console window <--- LOOK

#include <WinAPI.au3>
#include <WinAPIEx.au3>

Opt("WinTitleMatchMode", 2)  ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

;Example 1 - check notepad.exe
$pgm = "notepad.exe"
$pgm_title = "Notepad"
Send("#r") ;open run box
;wait for it
WinWait("Run") ;partial match
If Not WinActive("Run") Then WinActivate("Run")
WinWaitActive("Run")
Send($pgm & @CRLF) ;run program
$hWnd = WinWait($pgm_title) ;partial match

;now try to determine PID and name and path of process
$iPID = WinGetProcess($hwnd)
$iThreadID = _WinAPI_GetWindowThreadProcessId($hWnd, $iPID)

MsgBox(0, "Debug", "$pgm_title = '" & $pgm_title & "' PID = " &$iPID & " $iThreadID = " & $iThreadID)

$fn = _WinAPI_GetModuleFileNameEx($hWnd, 0) ;<-- I'm not passing the right parameter
MsgBox(0, "Debug", "full filename of process = '" & $fn & "'")

Exit

Share this post


Link to post
Share on other sites

I forgot about WinGetProcess, and can't remember why I opted for _WinAPI_GetWindowThreadProcessId.

Anyway, here is a basic way to get notepad exe from window.

#include <WinAPI.au3>
#include <WinAPIEx.au3>
#include <APIConstants.au3>

Run("notepad.exe")

$hWnd = WinWait("Untitled - Notepad") ; win handle

$iPID = WinGetProcess($hwnd) ; win process

$hProc = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS,0,$iPID) ;process handle

$fn = _WinAPI_GetModuleFileNameEx($hProc) ; process path

_WinAPI_CloseHandle($hProc) ; close handle

MsgBox(0, "Debug", "full filename of process = '" & $fn & "'")

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

What's wrong with _WinAPI_GetProcessFileName()?


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Jon - "The script writer knows what processes they are using so why try and determine it programmatically?" Not exactly always the case. Let me give you an actual example. I'm not at admin level. I turn on Au3Recorder because I want to generate a script to automate generating a restore point. I move to lower left and right click to bring up commands (because Send("#x") does not work - but that's another issue). Left click on run and type in (or send) "systempropertiesprotection.exe" then click OK. Up pops System Properties and I proceed to click Create, etc. I then stop the script and try running it. It doesn't work for all the reasons above. I need to either run everything at admin level (ugh) or somehow determine programmatically when I need to elevate.

You totally missed the part where I said there's no check that you can possibly make that will allow you to elevate the script with #RequireAdmin, whether you find out whether it's needed or not. #RequireAdmin is executed as soon as the script is run, there's nothing that you can do that will change whether to run it or not. There are other ways to elevate a program you want to run, but #RequireAdmin isn't the way to do it. RunAs/RunAsWait can be supplied the credentials needed to run a process.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Probably nothing, and I never seen it, but it does not work for me.

#include <WinAPIEx.au3>
#include <APIConstants.au3>

$fn = _WinAPI_GetProcessFileName(Run("notepad.exe"))

MsgBox(0, "Debug", "full filename of process = '" & $fn & "'")

Nothing short of openprocess with $PROCESS_ALL_ACCESS returns any result.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Strange as this works for me.

#include <APIConstants.au3>
#include <WinAPIEx.au3>

Local $iPID = Run('notepad.exe')
ProcessWait('notepad.exe', 5)
Sleep(2000)

MsgBox($MB_SYSTEMMODAL, '', _WinAPI_GetProcessFileName($iPID))

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Strange, I'm using V3.3.8.1 x64 and the latest version of WinAPIEx v3.8.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • DrLarch
      By DrLarch
      Is it possible to make an AutoIt script/exe always prompt for credentials regardless if the logged in account is admin or not? I know #requireadmin will prompt if the account isn't admin, but I need to run under different credentials regardless. I'm trying to have the script prompt for domain admin credentials even if the user is a local admin. I know how to do it via shortcut (ie. C:\Windows\System32\runas.exe /noprofile /user:domain\user "%windir%\system32\notepad.exe"), but would like it to be all contained cleanly with the one AutoIt script, if possible.
      Oops - sorry, started this in the wrong section. Can an admin please move?
    • hemichallenger
      By hemichallenger
      Hello everyone,
      Question: When adding #RequireAdmin within the script. It runs everything in the script with administrator rights. That's good because there are some functions i like to run with administrator rights. But I'm curious if it possible If within the script i had a option to open IE or Firefox for example. I don't want that to open with administrator rights. Is it possible when you select to open IE or Firefox, it opens that in a standard user?
      V/r
    • handofthrawn
      By handofthrawn
      I have a script that starts up all my work programs.  Programs like ventrilo, trillian, and other work stuff.  In the past week, I noticed two of these programs not starting up while 6 of them work the same.  I investigated and I notice these only start when I run the script as administrator (or add #requireadmin).  I use windows 7 and have no UAC.  I have not changed anything to my OS except install updates.  I'm so confused why only some of these programs now start up and require admin.  If I double click the executable or run in command prompt, they startup fine. 
      Does anyone have a clue what happened to cause this change and if I can change it back? 
      Below is the code I ran as a test.  Only the last program now starts up unless I add #requireadmin or right click and run the script as admin.  Thanks for any help.
       
      #include <Misc.au3>
      RUN("C:\Program Files\Ventrilo\Ventrilo.exe")
      Sleep(1000)
      RUN("C:\Program Files (x86)\Trillian\trillian.exe")
      RUN("C:\Program Files (x86)\Stealth Alerts\SAClient.exe") ;  This works just fine
       
    • Deye
      By Deye
      quoting the help file about #RequireAdmin:   "In case system doesn't have elevation mechanism (e.g. disabled UAC) new process will run under the same user as the original."   just to be clear about correctnone-correct cases regarding #RequireAdmin:   1. if the user is running under a disabled UAC, he wont be able to run as another user with admin rights ?   2. using #RequireAdmin and a disabled UAC wont give any message that user hasn't got admin privileges to run.., but then the script continue's (the script needs a routine to figure this out) ?   thanks
    • coffeeturtle
      By coffeeturtle
      Currently, if a program kicks off the UAC, the UAC properly lists the Program name, File origin and Program location. However, the Publisher for my compiled scripts comes up as Unknown.
      Is there a way to register/publish a script so that this field can be populated when the UAC is requested?
      Thank you.
      C-T