×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Run Windows-10 app elevated but without UAC prompt

Run Windows-10 app elevated but without UAC prompt

Run Windows-10 app elevated but without UAC prompt

(OP)
Hi all
This is driving me mad...
I need to send an update package (C#) to run on a Win-10 Pro machine in another country.

This package, among other locations, needs to copy files to 'C:\Program Files\' and therefore needs to run elevated.
The package works okay as I normally run it as Administrator; but cannot give the admin password to the users in the other country. Naturally UAC prevents it running and prompts for a password.

I know the Admin password so I thought I could create an app that auto elevates and then calls the update package and found what seems to be a good method at; https://stackoverflow.com/questions/2532769/how-to...

I produced the code below that simple doesn't work; still get the UAC prompt.

Any help would be most appreciated and save me shipping the equipment back from India to the UK.

--

using System.Diagnostics;
using System.Security;

namespace PackageUpdate
{
class Program
{
static void Main(string[] args)
{
var pass = new SecureString();
pass.AppendChar('s');
pass.AppendChar('e');
pass.AppendChar('c');
pass.AppendChar('r');
pass.AppendChar('e');
pass.AppendChar('t');

Process.Start(@"AccessTest.exe", "administrator", pass, "");
}
}
}

RE: Run Windows-10 app elevated but without UAC prompt

Instead of installing in Program Files, why not install in ProgramData. You don't need to be admin to install anything in ProgramData and it is globally visible to all users. I know that is not what ProgramData is meant for but it solves the admin privilege problem.

RE: Run Windows-10 app elevated but without UAC prompt

(OP)
Hi xwb

thank you for the speedy response; good idea but the problem is that the machine is already in India (i'm in the UK).
We need to update existing software that is already installed in program files and cannot give them the password.

Anyway I was mistaken; the code I posted does work and I had made another error; so all is well now.

Hope this thread is of help to others though.

Thanks
Les....

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close