Kinook Software Forums

Go Back   Kinook Software Forums > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-10-2008, 04:51 AM
Peter Schregle Peter Schregle is online now
Registered User
 
Join Date: 01-20-2003
Posts: 4
How to detect administrator rights under Vista

In http://www.kinook.com/Forum/showthre...?threadid=2258 you describe how to run Visual Build as an administrator under Vista.

How can I detect if Visual Build is run with administrator rights? I want to fail with an error, if it is run without administrator rights.

Thanks,
Peter
Reply With Quote
  #2  
Old 03-10-2008, 08:31 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 5,908
The simplest way would probably be to attempt something that requires admin/elevated privileges (for instance, writing to a registry key/value under HKEY_LOCAL_MACHINE or writing to a file under C:\Program Files) and fail the build if that fails.

Another option would be to call Bill Stewart's isadmin.exe utility (http://www.westmesatech.com/wast.html) from a Run Program action. Use a 'Success exit codes' field value of 1 to succeed for elevated admins and fail for unelevated admins and non-admins.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 07:21 PM.


Copyright 1999-2022 Kinook Software, Inc.