Jump to content

Server 2008 Run as Administrator


 Share

Recommended Posts

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

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

  • Moderators

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

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 by DCCD
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...