Is program being run as administrator 
Author Message
 Is program being run as administrator

I have not been on here for a long time, but I would appreciate it if anyone
could advise:-

1. Is it possible to check if a VB6 program is being 'Run as Administrator'
alternatively
2. Is it possible to force the program to run with Administrator's rights?

If so, how?

--
Regards, Mike Simpson
Penrith, NSW, Australia



Fri, 13 Jul 2012 07:05:32 GMT  
 Is program being run as administrator
Manifest file.  It was discussed recently...several times.  Look it up, or
Google it.

--
2025
If you do not believe in time travel,
your beliefs are about to be tempered.

http://www.facebook.com/group.php?gid=43606237254

|I have not been on here for a long time, but I would appreciate it if
anyone
| could advise:-
|
| 1. Is it possible to check if a VB6 program is being 'Run as
Administrator'
| alternatively
| 2. Is it possible to force the program to run with Administrator's rights?
|
| If so, how?
|
| --
| Regards, Mike Simpson
| Penrith, NSW, Australia
|
|
|



Fri, 13 Jul 2012 07:15:27 GMT  
 Is program being run as administrator


Quote:
> I have not been on here for a long time, but I would appreciate it if
> anyone could advise:-

> 1. Is it possible to check if a VB6 program is being 'Run as
> Administrator'
> alternatively

Yes, although it should rarely be necessary. You can call the IsUserAnAdmin
API function. This function, I believe anyway, will return False UNLESS the
user is a member of the Administrators group AND the app is running with
admin privileges. It's best to declare this function using its ordinal
number because it is not exposed by name under Win2000 (assuming you want
your app to run under Win2000).

Private Declare Function IsUserAnAdmin Lib "Shell32" Alias "#680" () As Long

If you don't care about Win2000, you can declare it as such:

Private Declare Function IsUserAnAdmin Lib "shell32" () As Long

Quote:
> 2. Is it possible to force the program to run with Administrator's rights?

Yes, but the user will still need to give consent if run on Vista or later
(assuming UAC is enabled), but this is not the approach to take unless your
app is intended ONLY to be run by admins....and in that case you shouldn't
have to "force" anything.

If you're asking these questions to work around what's been changed in Vista
and later, you're going to run into trouble sooner or later.  You need to
re-write your app so as NOT to require admin rights if the app could be used
by anyone who is not an administrator.

--
Mike



Fri, 13 Jul 2012 09:52:58 GMT  
 Is program being run as administrator
Thanks for responses. The app in question is a file utility for a game. It
makes changes to files in the Program Files folder and does not work unless
it is set to run as administrator.

Unfortunately many of the downloaders have no idea how to run programs as
administrator so it seemed like a good idea to at least check that the
program was being so run before they even got started.

Thanks - Mike


Quote:



>> I have not been on here for a long time, but I would appreciate it if
>> anyone could advise:-

>> 1. Is it possible to check if a VB6 program is being 'Run as
>> Administrator'
>> alternatively

> Yes, although it should rarely be necessary. You can call the
> IsUserAnAdmin API function. This function, I believe anyway, will return
> False UNLESS the user is a member of the Administrators group AND the app
> is running with admin privileges. It's best to declare this function using
> its ordinal number because it is not exposed by name under Win2000
> (assuming you want your app to run under Win2000).

> Private Declare Function IsUserAnAdmin Lib "Shell32" Alias "#680" () As
> Long

> If you don't care about Win2000, you can declare it as such:

> Private Declare Function IsUserAnAdmin Lib "shell32" () As Long

>> 2. Is it possible to force the program to run with Administrator's
>> rights?

> Yes, but the user will still need to give consent if run on Vista or later
> (assuming UAC is enabled), but this is not the approach to take unless
> your app is intended ONLY to be run by admins....and in that case you
> shouldn't have to "force" anything.

> If you're asking these questions to work around what's been changed in
> Vista and later, you're going to run into trouble sooner or later.  You
> need to re-write your app so as NOT to require admin rights if the app
> could be used by anyone who is not an administrator.

> --
> Mike



Sun, 15 Jul 2012 16:51:38 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. I am trying to update a record, i am not using data control

2. I am learning VB.NET and am wondering....

3. I am trying to update a record, i am not using data control

4. When is 5:00 AM not 5:00 AM? When it's 5:00 AM.

5. 50 users running Access, am I crazy.

6. Am I running in design-time ?

7. I am looking to hire an expert in Outlook 2000 programming

8. I am using the Compare MS Project COM Program and having issues

9. Am I too stupid to program VBA?

10. Hello, i am new at programming..

11. Who Am I Program in VB

12. I am looking for code or program example...

 

 
Powered by phpBB® Forum Software