ReaImDown Posted March 26, 2009 Share Posted March 26, 2009 (edited) I use vista on an admin acc.... and this doesnt give me the message box If IsAdmin() Then MsgBox(0, "", "Admin rights detected") but the actual code I am working with is: If $Pass = $Password Then If Not IsAdmin() Then MsgBox(0, "Problem...", "The settings cannot open because you are not a computer administrator...") endscript() Else ShellExecute($Location & "Settings.exe") endscript() EndIf Else Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(48, ''Incorrect Password!'', ''An incorrect password was used!'' & @CRLF & ''The program will continue to run.'')"') EndIf which always gives the message "The settings cannot open because you are not a computer administrator..." Edited March 26, 2009 by ReaImDown [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 26, 2009 Share Posted March 26, 2009 Do you have UAC enabled? Try adding #RequireAdmin if you want to run it as admin. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
ReaImDown Posted March 26, 2009 Author Share Posted March 26, 2009 Do you have UAC enabled? Try adding #RequireAdmin if you want to run it as admin. am trying to make 1 program execute another...ONLY IF the account is an admin account....if not, I dont want it to execute the other program, and give the user notice. I do believe uac is disabled... but either way.... if IsAdmin() then msgbox(0,"","") should give me the message box because I am an admin. [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
youknowwho4eva Posted March 26, 2009 Share Posted March 26, 2009 Remarks It returns 1 under Windows Vista only if running with a full administrator token (i.e. #RequireAdmin has been used, or has already been elevated by UAC). ^ from help file Giggity Link to comment Share on other sites More sharing options...
ReaImDown Posted March 26, 2009 Author Share Posted March 26, 2009 RemarksIt returns 1 under Windows Vista only if running with a full administrator token (i.e. #RequireAdmin has been used, or has already been elevated by UAC).^ from help filemust of missed that -.-' sorry... is there any way of doing this w/e #RequireAdmin... I dont want the script in question to require admin... but I need the second script to. [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 26, 2009 Share Posted March 26, 2009 am trying to make 1 program execute another...ONLY IF the account is an admin account....if not, I dont want it to execute the other program, and give the user notice. I do believe uac is disabled... but either way.... if IsAdmin() then msgbox(0,"","") should give me the message box because I am an admin.You're missing the point here, unless you are using #RequireAdmin you are not really an admin. This is due to the new security added in Vista. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
ReaImDown Posted March 26, 2009 Author Share Posted March 26, 2009 You're missing the point here, unless you are using #RequireAdmin you are not really an admin. This is due to the new security added in Vista.gotchya, so I will need to write a new script to execute the other script...or just let it slide w/o any admin rights....thank you [u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u] Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 26, 2009 Share Posted March 26, 2009 gotchya, so I will need to write a new script to execute the other script...or just let it slide w/o any admin rights....thank youNP .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Ascend4nt Posted March 26, 2009 Share Posted March 26, 2009 If you Right-Click an Executable and 'Run as Administrator', you don't need a #RequireAdmin keyword in your script, IsAdmin() will then work as expected. My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now