I put my vb6 exe program on flash drives of my students. Some of them say that it does not open. (Others have no problem and can left click). I told them to right click and "Run As Administrator". My program then opens. They are using school computers in a computer lab with windows 7. What is interesting is that #1 They are not administrators, #2 They do not have to enter any password. My question is: if that is the case, then why must they right click and Run As Aministrator? More important to me , is how can I remove they requirement that they Right click? I've read posts that it can be accomplished with a Manifest program added to my vb6 project as a custom resource. However, I can not follow any of the details of the posts. So I ask, how can I remove the 'Run as Admin' requirement?

Recommended Answers

All 6 Replies

Usually the Run As Administrator comes up when your program is trying to write to a protected location, for example if you are writing to a file in the folder where the application is installed.

In case you are interested, there is a free program called Elevated SHortcut which can be used to create a shortcut to launch an application that requires elevated privileges without displaying the UAC prompt. There is a native Windows method for doing this which involves adding an item to the task scheduler and creating a shortcut to do a demand run but it is very cumbersome to set up.

You may also be able to set this inside a windows 7 system by right clicking on the file and going to properties. Click the compatibility tab and at the bottom check the box for "Run this program as Administrator." This way it will always run as an administrator.

Unfortunately, it still results in the UAC prompt.

From experience the user membership is key in what will run as, ifthe user belongs to the right group the app wil run as provided ithas suffiecient rightts to do so, if the logged on user has admin rights then it wil run, right click run as admin then open and run. RJ is correct on that front but often there is no prompt for user/password

I think this article might help download the drive.info zip file run it show in this article.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.