Riteman -4 Light Poster

I need my application to start with administrator privilege. When I do it in app.manifest:

<requestedExecutionLevel level="asInvoker" uiAccess="false" />
to
<requestedExecutionLevel level="RequireAdministrator" uiAccess="false" />

I can start my application with administrator privilege. But it starts every time the application starts. I need to start

the application with administrator privilege only once at the first time of application usage.

Actually, I need to make the application to start with windows instead of starting manually. So to do that I used:

My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)

But it requires administrator privilege else it fails.

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.