![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Forcing my application to run with administrative privileges Hi, I have a VB6 based application and I read a post that I should post an entry here, so I am doing so. My application needs to run with administrative privileges. As a VB6 appliction it is not a .Net application that has built in support for manifests. Visual Basic v6.0 does not support direct manifests, but I am using InstallShield, which is running with administrative privileges. The question is what changes do I need to make to cause my application to forcibly run in administrative mode? Another post mentioned that all the manifest does is to make an entry to the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentViersion\AppCompatFlags\Layers hive/folder. I checked this path on my Windows Vista installation and I do not see the Layers sub-folder. Sadly, the post does not mention what the settings are. I figured as much that all the manifest does is to set a registry entry in the registry, which tells Windows that whenever and however the application runs, be it by shortcut or direct launch, that the privilege level should be as an administrator. What are the settings that I should make to the registry to affect my VB6 application to run as with administrator privileges? Is there another method? Thanks in advance, Sarah M. Weinberger ButterflyVista, LLC |
My System Specs![]() |
| | #2 (permalink) |
| Vista x64 Ultimate SP2, Windows 7 Ultimate x64 | Re: Forcing my application to run with administrative privileges Hi, I have a VB6 based application and I read a post that I should post an entry here, so I am doing so. My application needs to run with administrative privileges. As a VB6 appliction it is not a .Net application that has built in support for manifests. Visual Basic v6.0 does not support direct manifests, but I am using InstallShield, which is running with administrative privileges. The question is what changes do I need to make to cause my application to forcibly run in administrative mode? Another post mentioned that all the manifest does is to make an entry to the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentViersion\AppCompatFlags\Layers hive/folder. I checked this path on my Windows Vista installation and I do not see the Layers sub-folder. Sadly, the post does not mention what the settings are. I figured as much that all the manifest does is to set a registry entry in the registry, which tells Windows that whenever and however the application runs, be it by shortcut or direct launch, that the privilege level should be as an administrator. What are the settings that I should make to the registry to affect my VB6 application to run as with administrator privileges? Is there another method? Thanks in advance, Sarah M. Weinberger ButterflyVista, LLC This tutorial will show you the normal method to have your program always run with "Run this program as an administrator". Compatibility Mode If this option is grayed out and you need to force the program to, then this tutorial will show you how using the method you described. Compatibility Mode List of Programs Shawn |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Forcing my application to run with administrative privileges Hello, A manifest is an XML file that is embedded into your application, in the same way that your application's icon file is embedded into it. When your application is executed, Windows loads the manifest and uses it to determine how to start your application. It does not change/modify the registry. Applications should not rely on the application compatability layer to mark their application as requiring elevation. All applications that are designed to run on Vista should include a manifest (whether they need to elevate or not) ![]() You have two options: You can either embed the manifest into your application, or you can create a manifest file named yourapplication.exe.manifest (where yourapplication.exe is the filename of your application) and install it to the same location that your application ..exe is installed to. Obviosuly, the best way when distributing your application is to embed it into your .exe. To do that, you need a free tool called mt.exe (available from the Windows SDK). The command line looks like this (Note the ;#1 at the end is important): mt.exe -manifest "path_to_manifest" –outputresource:"path_to_exe";#1 -- - JB Microsoft MVP Windows Shell/User "Sarah M. Weinberger" <mweinberger@xxxxxx> wrote in message news:uChIR$lRIHA.3916@xxxxxx Quote: > Hi, > > I have a VB6 based application and I read a post that I should post an > entry here, so I am doing so. My application needs to run with > administrative privileges. As a VB6 appliction it is not a .Net > application that has built in support for manifests. Visual Basic v6.0 > does not support direct manifests, but I am using InstallShield, which is > running with administrative privileges. The question is what changes do I > need to make to cause my application to forcibly run in administrative > mode? Another post mentioned that all the manifest does is to make an > entry to the > > HKLM\SOFTWARE\Microsoft\Windows NT\CurrentViersion\AppCompatFlags\Layers > > hive/folder. I checked this path on my Windows Vista installation and I do > not see the Layers sub-folder. Sadly, the post does not mention what the > settings are. I figured as much that all the manifest does is to set a > registry entry in the registry, which tells Windows that whenever and > however the application runs, be it by shortcut or direct launch, that the > privilege level should be as an administrator. > > What are the settings that I should make to the registry to affect my VB6 > application to run as with administrator privileges? > > Is there another method? > > Thanks in advance, > > Sarah M. Weinberger > ButterflyVista, LLC > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Forcing my application to run with administrative privileges Hi Jimmy and Brink, I was finally able to embed a manifest thanks to the prolonged help of someone in another newsgroup. I do got to comment that the manifest has to be just right and that finding out how to add the manifest to an existing resource (using VC++, as that has a nice resource editor) was not all that obvious, but once done it works. My only complaint to Microsoft is that the message that UAC pops up should be a bit more clear. It is not obvious that the application requests to run in elevated / administrative mode, even though that is what the confirmation screen asks. Sarah |
My System Specs![]() |
| | #5 (permalink) |
| Vista x64 Ultimate SP2, Windows 7 Ultimate x64 | Re: Forcing my application to run with administrative privileges Hi Jimmy and Brink, I was finally able to embed a manifest thanks to the prolonged help of someone in another newsgroup. I do got to comment that the manifest has to be just right and that finding out how to add the manifest to an existing resource (using VC++, as that has a nice resource editor) was not all that obvious, but once done it works. My only complaint to Microsoft is that the message that UAC pops up should be a bit more clear. It is not obvious that the application requests to run in elevated / administrative mode, even though that is what the confirmation screen asks. Sarah Glad to hear you got it resolved. Thank you for the feedback. Shawn |
My System Specs![]() |
| | #6 (permalink) |
| XP x64 | Re: Forcing my application to run with administrative privileges Hello, A manifest is an XML file that is embedded into your application, in the same way that your application's icon file is embedded into it. When your application is executed, Windows loads the manifest and uses it to determine how to start your application. It does not change/modify the registry. Applications should not rely on the application compatability layer to mark their application as requiring elevation. All applications that are designed to run on Vista should include a manifest (whether they need to elevate or not) ![]() You have two options: You can either embed the manifest into your application, or you can create a manifest file named yourapplication.exe.manifest (where yourapplication.exe is the filename of your application) and install it to the same location that your application ..exe is installed to. Obviosuly, the best way when distributing your application is to embed it into your .exe. To do that, you need a free tool called mt.exe (available from the Windows SDK). The command line looks like this (Note the ;#1 at the end is important): mt.exe -manifest "path_to_manifest" –outputresource:"path_to_exe";#1 -- - JB Microsoft MVP Windows Shell/User mt.exe:command line error c10100a8:No manifest outputs were specified to store the final manifest. Use the /? option for help on usage and samples. I figured since you are very experienced with this, you'd probably know right off what needs to be added/changed. Thanks much in advance. Hopefully this will work out for my situation. |
My System Specs![]() |
| | #7 (permalink) |
| Vista Home Premium 32bit | Re: Forcing my application to run with administrative privileges I figured since you are very experienced with this, you'd probably know right off what needs to be added/changed. Thanks much in advance. Hopefully this will work out for my situation. ![]() If you haven't found a solution, try deleting hyphens and inserting them manually once again. It should help. The old hyphens probably aren't normal hyphens. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: How to know if a user has administrative privileges | VB Script | |||
| No administrative privileges on Administrator account? | General Discussion | |||
| Losing administrative privileges something like Nidma virus | System Security | |||
| Forcing programs to run with standard user privileges | Vista security | |||
| Administrative Privileges | Vista General | |||