Datus Posted April 30, 2009 Share Posted April 30, 2009 My code wont work (opening files etc) unless i run as administrator by right clicking the .exe I remember this being an issue with Vista and Autoit removed the need. I have put #RequireAdmin at the top of my code but doesnt work. I am logging in as a Domain Admin user. Any Ideas for a work arround? or am I missing something. We live as we dream alone! Link to comment Share on other sites More sharing options...
BrettF Posted May 1, 2009 Share Posted May 1, 2009 Hi, Could you please post some code replicating your problem. Thanks, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Datus Posted May 1, 2009 Author Share Posted May 1, 2009 Bits relevant here. I run the program from Program Files. #RequireAdmin #region;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_run_tidy=y #AutoIt3Wrapper_run_obfuscator=y #endregion;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIListBox.au3> #include <file.au3> #include <Array.au3> #include <GUIConstants.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <Date.au3> Global $LastUpdatedFile $LastUpdatedFile = @WorkingDir & "\_LastUpdatedFile.txt" $CheckOk = FileOpen($LastUpdatedFile, 1);Section Open Files Note: Open synopsis text files if requested later! If $CheckOk = -1 Then MsgBox(0, $CheckOk & ":Open error with file:", $LastUpdatedFile) Exit EndIf EndIf comes back with -1 We live as we dream alone! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 1, 2009 Moderators Share Posted May 1, 2009 On Vista and Windows 2008 the Program Files directory is protected, and applications cannot write/open files in it unless ran as administrator. I don't use either OS purposely, but others I work with avoid the program files directory purposely because of the restriction(s). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
DCCD Posted May 1, 2009 Share Posted May 1, 2009 (edited) i don't like vista #RequireAdmin #region;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_run_tidy=y #AutoIt3Wrapper_run_obfuscator=y #endregion;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIListBox.au3> #include <file.au3> #include <Array.au3> #include <GUIConstants.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <Date.au3> Global $LastUpdatedFile $LastUpdatedFile = FileOpenDialog("OpenFile", @WindowsDir & "", "TXT (*.txt;*.inf)|INF (*.txt;*.inf)", 1 + 4 ) ; $CheckOk = FileOpen($LastUpdatedFile, 1);Section Open Files Note: Open synopsis text files if requested later! MsgBox(0, $CheckOk & ":XXXOpen error with file:", $LastUpdatedFile) If $CheckOk = -1 Then MsgBox(0, $CheckOk & ":Open error with file:", $LastUpdatedFile) Exit EndIf Edited May 1, 2009 by DCCD [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
Datus Posted May 1, 2009 Author Share Posted May 1, 2009 Ive put it in public documents and it works fine. Thanks for the replies. I will look at FileOpenDialog at a later date. Cheers again. We live as we dream alone! 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