PhilippeHauke Posted February 28, 2013 Share Posted February 28, 2013 Hi, I may miss an obvious point but I dug into forum and googled but it has been no help so far. I am Vista and AutoItV3.3.8.1 ================= MsgBox(0,"", "aa") ================= works fine but ================= #RequireAdmin MsgBox(0,"", "aa") ================= popups UAC panel asking me to continue or cancel (should mean I am actually admin,isn't it?) and exits (code 0) whatever I click "continue" or "cancel" Any clue? Thanks in advance Link to comment Share on other sites More sharing options...
guinness Posted February 28, 2013 Share Posted February 28, 2013 #RequireAdmin is when you need your application to run with full administration rights. For a message box this isn't necessary. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 28, 2013 Moderators Share Posted February 28, 2013 Hi, PhilippeHauke. The #RequireAdmin is doing just what it is designed to, telling the system your script requires Administrative access (which then kicks off the UAC). I am a little confused as to what you're asking. Are you saying that after clicking OK on the UAC, you're not seeing the message box? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
PhilippeHauke Posted February 28, 2013 Author Share Posted February 28, 2013 Hi, Thanks for reading my post. Yes, you are right: the program exits directly without displaying the message box. Link to comment Share on other sites More sharing options...
guinness Posted February 28, 2013 Share Posted February 28, 2013 So you're happy now? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
PhilippeHauke Posted February 28, 2013 Author Share Posted February 28, 2013 Hi Guiness, Thanks your your interest too. My goal is not to display a msgbox but this is the simplest sample of code I found to illustrate the problem I face. In fact I try to create a user account (using code that works properly with XP) but I struggle porting it to Vista Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 28, 2013 Moderators Share Posted February 28, 2013 Why don't you post your code, so we can take a look "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
PhilippeHauke Posted February 28, 2013 Author Share Posted February 28, 2013 Because this short code exactly exhibits the issue I face. I have actually tested it. Don't you agree that the message box should display when I click the "continue" button? It does not. Don't you agree that the UAC panel (asking for "continue" or "cancel") attests that I am running as administrator? In fact before reaching this basic code I made some tries and whatever the code I use with "#RequireAdmin", it is not executed. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 28, 2013 Moderators Share Posted February 28, 2013 PhilippeHauke,When I run the simple code you posted above on my Vista machine I see the MsgBox - as I would expect. So there must be something else happening which prevents you from seeing it. I am sure you understand that unless you give us some more clues we cannot help you any further. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
PhilippeHauke Posted February 28, 2013 Author Share Posted February 28, 2013 I thank you for your help and it is clear to me that it is my interest to help you so you can help me.So Melba23, you run the code with "#RequireAdmin", you get the UAC panel, you click "Continue" and the msgBox displays "aa"If the same code works fine in your environment and not in mine, I conclude that our environments differ.To me, here are some specifications of my environment that might influenceVista: "Edition Familiale Premium" - Service Pack 2 - 64 bitsAutoIt: V3.3.8.UAC is "On"if you have in mind any other information (register, environment variable...) that might influence, please let me know. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 28, 2013 Moderators Share Posted February 28, 2013 PhilippeHauke, You and I both have the same OS and AutoIt versions. Do you have any AV or HIPS programs running which might not permit you to run a second instance of AutoIt as an Admin? I have to confirm each time with my Comodo HIPS that I am allowing this to happen. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
PhilippeHauke Posted February 28, 2013 Author Share Posted February 28, 2013 Melba23,I don't think but herebelow is the list of my installed programsAdobe Flash Player 11 ActiveXAdobe Reader 9Atheros Communications Inc® L1 Gigabit Ethernet driverAusLogics Disk DefragAutoIt v3.3.8.1Avast ! Free antivirusCute PDf writer 3.0DropboxExpertToolGoogle chromeMicrosoft Expression WebMicrosoft office Enterprise 2007Microsoft Office Project Professional 2007Microsoft Office Visio Professional 2007Microsoft Visual C++ 2005 RedistributableMicrosoft Visual C++ 2008 Redistributable – x86…Mozilla Firefox 18.02Mozilla maintenance ServicemuveeNow2.1Nvidia driversPyScripter 2.5.3Python2.7 PySide-1.1.2Python2.7 pywin32-218Python2.7Realtek High Defintion Audio DriverRide Equitation nouvelle génération 1Windows desktop search : add-in for files on Microsft Networks Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 28, 2013 Moderators Share Posted February 28, 2013 Number 6 - Avast! Try disabling it. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
PhilippeHauke Posted February 28, 2013 Author Share Posted February 28, 2013 I disabled Avast agents + Windows firewall but the behavior did not change (still KO with #RequireAdmin).For information here are the traces of the run:>"C:Program Files (x86)AutoIt3SciTE..autoit3.exe" /ErrorStdOut "W:_ToolsAutoItPC_OLIVIERessai4.au3">Exit code: 0 Time: 2.270As you can notice, I run Autoit in 32 bits mode. Might it explain anything? Link to comment Share on other sites More sharing options...
PhilippeHauke Posted February 28, 2013 Author Share Posted February 28, 2013 Fyi, I uninstalled and reinstalled AutoIt => non change (the problem is still there) Maybe more interesting. Before I always ran the code from ScITE. After, I tried to run it from the file browser. I compiled (x86) and ran it using "run as administrator", I got 3 popups; one of them (the last one) requesting username and pwd. I filled the <hostname>/<username> and <pwd> and I finally got a message "the specified username is not valid". I am not sure that the syntax <hostname>/<username> (with all characters in lowercase) is the correct one. Any idea? Link to comment Share on other sites More sharing options...
PhilippeHauke Posted March 1, 2013 Author Share Posted March 1, 2013 I have a major progress to report and then some more accurate questions.In fact, the popup asking for username/pwd (see my previous post) comes because my script is stored in a network disk (see the traces in my post before last "W:_ToolsAutoItPC_OLIVIERessai4.au3")When I move my script to my desktop and run it (whatever it is from SciTE or from file browser), it works well (I mean the msgbox is displayed). So I am starting to get happy and I would get fully happy if got a mean to run the scripts directly from its network disk location- mode 1 (run from file browser): what is the correct syntax of the username to fill in the network access popoup ("//diskstation/olivier" does not work- mode 2 (run from SciTE): is there any way to run a #RequireAdmin script that is stored in a network disk. As i told you, when I run it, there is no error/warning message but no instructions are executed Thanks in advance Link to comment Share on other sites More sharing options...
PhilippeHauke Posted March 3, 2013 Author Share Posted March 3, 2013 Hreeafter is a recap (I hope it may motivates feedbacks) I store my AutotIt scripts on a NAS disk and I have noticed that when I run a script from SciTE with #requireAdmin# statement then no instructions are executed and no message is displayed (SciTE just reports exit code 0). If I remove the #requireAdmin statement then the instructions of the script get properly executed. If I copy the script with the #requireAdmin statement on a local disk and run it from SciTE then it works properly (I need to confirm the run request in a popup first) Would anybody have an idea about the reasons of this behaviour and the way to run the remote script directly from SciTE? Link to comment Share on other sites More sharing options...
BrewManNH Posted March 3, 2013 Share Posted March 3, 2013 Its because when you use RequireAdmin, it restarts the script under different credentials. Those credentials don't have the network drive mapped or accessible, so it can't find the file(s) to run. 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 GudeHow 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 Link to comment Share on other sites More sharing options...
PhilippeHauke Posted March 4, 2013 Author Share Posted March 4, 2013 Thanks BrewManNH, So, I understand that either I use #RequireAdmin and I then cannot access network resources or I don't use it and I then cannot access features such as user account creation, software installation.... Am I right ? Is there a way to workaround this frustrating status? Isn't there any way to keep or recover my user account (here my user account has administrator privilleges) with #RequireAdmin? Link to comment Share on other sites More sharing options...
BrewManNH Posted March 4, 2013 Share Posted March 4, 2013 If you have to use #RequireAdmin, then you have to remap the drives that the files are located on afterwards. Otherwise, the script can't find the files. Use DriveMapAdd to remap the drive, you probably don't want the drive mapping to be presistent though so make sure you set that to no. PhilippeHauke 1 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 GudeHow 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 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