administrator

Launching an administrative interactive process when a standard user is logged on

蓝咒 提交于 2019-11-27 09:23:36
I have a system service which creates a helper interactive process as administrator so that it can access some desktop-related resources, including the BlockInput() function and NVIDIA's NVAPI functions, which cannot be run from a service. When the logged on user was a member of Administrators, the following worked: Set privilege levels, including SE_TCB_NAME Get active session ID with WTSGetActiveConsoleSessionId() Get logged on user from session ID with WTSQueryUserToken() GetTokenInformation() with TokenLinkedToken DuplicateTokenEx() with SecurityImpersonation Launch process with

How do you request administrator permissions using NSIS?

Deadly 提交于 2019-11-27 08:27:04
I am quite new with NSIS. I am trying to request administrator permissions in order to run the installer, as it messes around a bit with registries. My problem with "RequestExecutionLevel" and "MULTIUSER_EXECUTIONLEVEL" is that they both absolutely block any non-Admin user from opening the installer, even when selecting "Run as Administrator" in the context menu. I have tried using the RunAs DLL, but I have not found a single thread as to what to put in the $command variable passed to "RunAsW" function. Here is my (pretty hacked-up) code: StrCpy $0 0 StrCpy $1 "" System::Call 'RunAs:

Visual Studio output file permissions?

六月ゝ 毕业季﹏ 提交于 2019-11-27 07:37:47
I'am using Visual Studio 2010, how to set or automatically change owner of the output file from Visual Studio (such as executable file) to user other than administrator? all output files currently is owned by Administrator (due to Visual studio is launch by administrative privilege), so sometime I can't delete those files due to access permissions. sometime visual studio itself can't delete it too (after i ran the executable) until few minutes, its really annoying when I need to rebuild those executable. anyone know what's the actual problem here? error message is : error LNK1168: cannot open

What registry access can you get without Administrator privileges?

こ雲淡風輕ζ 提交于 2019-11-27 06:52:34
I know that we shouldn't being using the registry to store Application Data anymore, but in updating a Legacy application (and wanting to do the fewest changes), what Registry Hives are non-administrators allowed to use? Can I access all of HKEY_CURRENT_USER (the application currently access HKEY_LOCAL_MACHINE ) without Administrator privileges? Euro Micelli In general, a non-administrator user has this access to the registry: Read/Write to: HKEY_CURRENT_USER Read Only: HKEY_LOCAL_MACHINE HKEY_CLASSES_ROOT (which is just a link to HKEY_LOCAL_MACHINE\Software\Classes ) It is possible to change

How to add administrator privileges to AutoHotkey script?

限于喜欢 提交于 2019-11-27 06:21:10
问题 I compiled it to an executable, but to open it I have to right-click and press "Run as administrator". I want it to request admin privileges each time I run it, but how to do it? I can't do this: Because then it doesn't work when I copy it to a second computer. 回答1: Try adding this to the auto-execute section (top of the script): ; If the script is not elevated, relaunch as administrator and kill current instance: full_command_line := DllCall("GetCommandLine", "str") if not (A_IsAdmin or

How to create a Run As Administrator shortcut using Powershell

白昼怎懂夜的黑 提交于 2019-11-27 03:15:20
问题 In my PowerShell script, I create a shortcut to a .exe (using something similar to the answer from this question): $WshShell = New-Object -comObject WScript.Shell $Shortcut = $WshShell.CreateShortcut("$Home\Desktop\ColorPix.lnk") $Shortcut.TargetPath = "C:\Program Files (x86)\ColorPix\ColorPix.exe" $Shortcut.Save() Now, when I create the shortcut, how do I add to the script to make it default to running as Administrator? 回答1: This answer is a PowerShell translation of an excellent answer to

Start Process with administrator right in C#

醉酒当歌 提交于 2019-11-26 23:16:11
问题 I have to start a command line program with System.Diagnostics.Process.Start() and run it as Administrator. This action will also be run by a Scheduled Task every day. 回答1: I've just try to use : Process p = new Process(); p.StartInfo.Verb = "runas"; this works fine if I'm running my program as Administrator, but when the Scheduled Task runs it, it doesn't take the 'runas' in consideration I think. 回答2: A better secure option to run a process with login and password is use the SecureString

What precisely does 'Run as administrator' do? [closed]

落爺英雄遲暮 提交于 2019-11-26 21:57:53
On Windows 7, I have a command-line program that fails due to file write permission errors, and popping up annoying UAC dialogs every time I run command-line programs that are from an 'unknown publisher'. However, if I start my console by right clicking and choosing 'run as administrator', then the install works fine, even if the UAC dialogs are still present. My user is already a member of the 'administrators' group, so what precisely does 'run as administrator' do that makes my install work? My specific question is precisely: What does 'run as administrator' do? Neither of the answers thus

Detect if program is running with full administrator rights

房东的猫 提交于 2019-11-26 20:49:28
I need to determine if my program is running with full administrator rights. By that I mean if uac is turned on (for win vista/7) that I need to determine if the program actually has admin rights (like if the user right clicked and selected "run as administator") and not limited by uac. How do I do this in C++? Win9x: Everyone is "admin" NT4: OpenThreadToken/OpenProcessToken + GetTokenInformation(...,TokenGroups,...) on DOMAIN_ALIAS_RID_ADMINS SID in a loop 2000+: OpenThreadToken/OpenProcessToken + CheckTokenMembership on DOMAIN_ALIAS_RID_ADMINS SID Other alternatives are: IsUserAnAdmin or

How to run vbs as administrator from vbs?

安稳与你 提交于 2019-11-26 20:37:17
Can anyone help me with running vbs from itself but with administrator rights? I need rename computer with Windows 8 via VBScript, but it's possible only if I run my script through administrator command line (CMD → Run as Administrator → runScript.vbs). If I start script with classic CMD the computer isn't renamed. My idea is I start script with user rights, without parameters and if there is no parameter, the script re-runs itself with admin rights and with parameter as identificator "I'm admin". Does anyone know how I can do this? Edit: I tried this: If WScript.Arguments.Count = 0 Then Set