Questions tagged [uac]

This tag is used for questions concerning the User Account Control (UAC) security feature of Windows Vista, Windows 7, 8 and higher versions of Windows.

This tag is used for questions concerning the User Account Control (UAC) security feature of Windows Vista, Windows 7, 8 and higher. This feature, enabled by default, reduces the privilege level of an Administrator account to those of Limited User account. Because of this, many programs that worked in previous Windows versions do not work as expected in Windows Vista, Windows 7, 8 and higher.

With UAC, each user having admin rights would have split-token - one for regular usage and one for administrative usage. Regular token won't be able to have administrative permissions (such as changing system-time, or installing applications). Administrative token would have rights to do any administrative activity.

A process (and all its threads) would have either of these tokens, and they cannot change to another token (for e.g. from Regular to Admin). User has to respond to UAC prompt when opening Admin mode (elevated) application.

Programmers can specify if their programs to require admin (elevated) token so that OS will always attempt to launch the process with elevation. This information is put into EXE header itself.

1365 questions
1035
votes
12 answers

Can you force Visual Studio to always run as an Administrator in Windows 8?

In Windows 7, you could go into a programs compatibility settings and check off to always run as an Administrator. Is there a similar option in Windows 8? I've always disabled UAC on my machines, and did the same after my Windows 8 upgrade, or so I…
Brian Surowiec
  • 16,503
  • 7
  • 39
  • 64
227
votes
16 answers

How can I auto-elevate my batch file, so that it requests from UAC administrator rights if required?

I want my batch file to only run elevated. If not elevated, provide an option for the user to relaunch batch as elevated. I'm writing a batch file to set a system variable, copy two files to a Program Files location, and start a driver installer. If…
PDixon724
  • 2,273
  • 3
  • 12
  • 4
200
votes
12 answers

HttpListener Access Denied

I am writing an HTTP server in C#. When I try to execute the function HttpListener.Start() I get an HttpListenerException saying "Access Denied". When I run the app in admin mode in windows 7 it works fine. Can I make it run without admin mode?…
Randall Flagg
  • 4,212
  • 7
  • 30
  • 43
193
votes
16 answers

How to request Administrator access inside a batch file

I am trying to write a batch file for my users to run from their Vista machines with UAC. The file is re-writing their hosts file, so it needs to be run with Administrator permissions. I need to be able to send them an email with a link to the…
skb
  • 28,056
  • 29
  • 91
  • 140
103
votes
11 answers

Request UAC elevation from within a Python script?

I want my Python script to copy files on Vista. When I run it from a normal cmd.exe window, no errors are generated, yet the files are NOT copied. If I run cmd.exe "as administator" and then run my script, it works fine. This makes sense since User…
jwfearn
  • 26,394
  • 26
  • 89
  • 117
85
votes
6 answers

How to elevate privileges only when required?

This question applies to Windows Vista! I have an application which normally works without administrative privileges. There is one activity which does need administrative privilege but I don't want to start the application itself with higher…
Hemant
  • 18,354
  • 22
  • 87
  • 123
83
votes
10 answers

Detect if running as Administrator with or without elevated privileges?

I have an application that needs to detect whether or not it is running with elevated privileges or not. I currently have code set up like this: static bool IsAdministrator() { WindowsIdentity identity = WindowsIdentity.GetCurrent(); …
MiffTheFox
  • 20,290
  • 14
  • 66
  • 90
82
votes
8 answers

Windows batch file starting directory when 'run as admin'

I have a batch file which is in a directory and must be run from there as well because it updates files within this directory. This works perfectly fine, except when the user runs the batch file as administrator (required on Vista). Then the…
Marc
  • 8,262
  • 12
  • 55
  • 72
82
votes
9 answers

How to run a program automatically as admin on Windows 7 at startup?

I created my own parental control app to monitor my kids activity. The app's only GUI is a task bar icon. The program is installed as admin. I'd like this program to be started up automatically as admin user on Windows startup, so that standard…
newman
  • 6,333
  • 14
  • 71
  • 119
70
votes
7 answers

Cannot access network drive in PowerShell running as administrator

I'm running PowerShell in a Windows 7 x64 virtual machine. I have a shared folder on the host mapped as a network drive (Z:). When I run PS normally I can access that drive just fine, but if I run it "as administrator" it tells me: Set-Location :…
EMP
  • 51,372
  • 47
  • 157
  • 214
61
votes
9 answers

XAMPP installation on Win 8.1 with UAC Warning

I am trying to install Xampp win32-1.8.2 on Windows 8.1. I get a message saying" Because an activated user account User Account on your system some functions of XAMPP are possibly restricted." I've tried to change the user account control settings…
lynncasiano
  • 651
  • 1
  • 7
  • 10
57
votes
6 answers

How to screen shot a UAC prompt?

I'm trying to document a work flow with a series of screen shots. At one point in the flow, a UAC prompt appears, and I'd like to grab a bitmap of it to make my storyboard complete. Because UAC prompts are on a virtual desktop (or something like…
Adrian McCarthy
  • 41,073
  • 12
  • 108
  • 157
55
votes
5 answers

Requesting administrator privileges at run time

Is it possible to get a C++ application running in Windows to request administrator privileges from the operating system at run time? I know it can be done at compile time, but can't seem to find anywhere whether it can be done at run time. Thanks…
JonaGik
  • 1,447
  • 5
  • 24
  • 35
55
votes
2 answers

The UAC prompt shows a temporary random Program Name for msi, can the correct name be displayed?

I'm building an MSI installer for windows and sign the installer using signtool. When I run the .msi to test it, the UAC (User Account Control) prompt shows up to ask me if I want to allow the installation to proceed. That's fine, but the prompt…
Scott Langham
  • 53,246
  • 34
  • 122
  • 193
54
votes
2 answers

Allowing connection to .NET COM server with mismatching integrity level

I'm having an issue with a COM based client-server setup. The COM server is written in C# (.NET 4.0) and runs as a (registered) local server. Depending on which application connects to the server, other clients will receive a Server execution failed…
Thorarin
  • 43,849
  • 11
  • 70
  • 108
1
2 3
90 91