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;
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, "");
}
}
}
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;
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, "");
}
}
}