-
June 24th, 2010, 12:42 AM
#1
Programmatic way to run a program as administrator in Windows 7
Hi
I have created a VB6 dll named 'PDFConversion.dll' and wanted to register in windows7.
But it fails with access denied error. How do I register it as administrator(ie. Run as administrator') programmatically without the user having to right-click the .dll and say Run As Administrator.
So on double clicking the dll user should be prompt with the admin user name and password if he is not as admin user (Same as when he right click and select run as administrator' option). I am using vb6
Thanks
Minu
-
June 24th, 2010, 01:08 AM
#2
Re: Programmatic way to run a program as administrator in Windows 7
use an install package...
Good Luck
-
June 24th, 2010, 01:26 AM
#3
Re: Programmatic way to run a program as administrator in Windows 7
Thanks for the reply
Could you please specify which install package and how to create it.
-
June 24th, 2010, 01:31 AM
#4
Re: Programmatic way to run a program as administrator in Windows 7
Originally Posted by minums
So on double clicking the dll user should be prompt with the admin user name and password if he is not as admin user (Same as when he right click and select run as administrator' option). I am using vb6
You cannot "run" a dll file! It is just an application extension which helps to make your program work.
-
June 24th, 2010, 01:52 AM
#5
Re: Programmatic way to run a program as administrator in Windows 7
Yes, i mean to say register the dll
-
June 24th, 2010, 01:54 AM
#6
Re: Programmatic way to run a program as administrator in Windows 7
Actually what i do now is, run cmd.exe with the option
'run as admin' and register the dll with command "regsvr32<space> dll path.
These process i need to do programatically so that the user need not do all such stuffs.
Last edited by minums; June 24th, 2010 at 02:04 AM.
-
June 24th, 2010, 02:09 AM
#7
Re: Programmatic way to run a program as administrator in Windows 7
-
June 24th, 2010, 07:51 AM
#8
Re: Programmatic way to run a program as administrator in Windows 7
What to be done with this?
-
June 24th, 2010, 10:01 AM
#9
Re: Programmatic way to run a program as administrator in Windows 7
Always use [code][/code] tags when posting code.
-
June 24th, 2010, 11:26 AM
#10
Re: Programmatic way to run a program as administrator in Windows 7
If your application runs as administrator, it could call the RegisterServer() procedure of your dll.
So it is registered by an administrative process.
Works only if your program is running with administration rights.
-
June 24th, 2010, 11:39 PM
#11
Re: Programmatic way to run a program as administrator in Windows 7
My application runs in power user platform not administrator
-
June 24th, 2010, 11:43 PM
#12
Re: Programmatic way to run a program as administrator in Windows 7
I have installed Visual Studio Installer. Is that trusted installer? how to use it?
How installer address my requirement?
Please tell me
-
June 25th, 2010, 03:12 AM
#13
Re: Programmatic way to run a program as administrator in Windows 7
Yes it is, it is the replacement to the PDW, its version, if you have the right one is 1.1. How to use it? Read the documentation that came with it! By using an installer to install your program/dll/etc. It will install the object to where it belongs and if it needs to be registered, it will do it for you. No need to mess with the registry or regsrv32. It puts you or your user just a double click away from having the program/dll/etc installed on the machine and ready for use. Reboot may be required
Good Luck
-
June 25th, 2010, 03:55 AM
#14
Re: Programmatic way to run a program as administrator in Windows 7
Thanks for your reply
Actually i have a software with the basic installation done. as the part of customization, we make changes in code. This can be dll change, exe or DB changes. All these changes are given as upgrade. Can i use this installer to do the same?
While upgrading all the dll's will be simply registered with DLLSelfRegister function. Now i just want to register a dll in client machine instead of installing the software. So on a double click the registration should take the path of 'Run as administrator'
For this which function should i use instead of DLLSelfRegister.
-
June 25th, 2010, 08:24 PM
#15
Re: Programmatic way to run a program as administrator in Windows 7
No, but that's why ClickOnce Deployment was invented. Unfortunately, after VB6.
Read up on VS2010 ClickOnce Deployment.
You can deploy an app, and have it automatically download updates.
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
|