|
-
Feb 25th, 2008, 12:52 AM
#1
Thread Starter
PowerPoster
Check if adminstrator vista
Does anyone know how to check if program needs to be installed as adminstrator or how to run something than will return an error if command needs to be run as adminstrator so i can trap the error ?
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Feb 25th, 2008, 07:02 PM
#2
Re: Check if adminstrator vista
If your question is "Does this user I'm running under have admin rights (i.e. am I running elevated)?" you could use this:
IsUserAnAdmin: Determine if the Current User is an Administrator
I hope that helps! Nice and concise.
-
Feb 25th, 2008, 08:02 PM
#3
Thread Starter
PowerPoster
Re: Check if adminstrator vista
 Originally Posted by dilettante
thanks for the link, unfortunately i don't have vista to check right away
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Feb 26th, 2008, 08:28 AM
#4
Re: Check if adminstrator vista
It works on Win2K and later. Prior to Vista it returns True if running under an admin account. Starting with Vista it only returns True when running with elevation.
-
Feb 26th, 2008, 11:15 AM
#5
Re: Check if adminstrator vista
Well, if you're using an installer then it usually takes care of everything for you. If not, just incorporate the manifest in your application that automatically elevates your application (if you're already an admin it does nothing).
-
Feb 26th, 2008, 03:16 PM
#6
Re: Check if adminstrator vista
If you are attempting to write an installer yourself, you should use one of the already tried and tested ones. You really can't write one totally in VB anyway...
-
Mar 4th, 2008, 02:52 AM
#7
Re: Check if adminstrator vista
 Originally Posted by randem
If you are attempting to write an installer yourself, you should use one of the already tried and tested ones. You really can't write one totally in VB anyway...
Sure you can. Just include the vb 6 runtimes and other dependancy files on the CD in the app dir as that is the first location Windows looks for dependancy files.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|