What registry access can you get without Administrator privileges?

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 some of these permissions on a key-by-key basis, but it’s extremely rare. You should not have to worry about that. For your purposes, your application … Read more

How do I set a Windows scheduled task to run in the background? [closed]

As noted by Mattias Nordqvist in the comments below, you can also select the radio button option “Run whether user is logged on or not”. When saving the task, you will be prompted once for the user password. bambams noted that this wouldn’t grant System permissions to the process, and also seems to hide the … Read more

How do you request administrator permissions using NSIS?

Outfile RequireAdmin.exe RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) !include LogicLib.nsh Function .onInit UserInfo::GetAccountType pop $0 ${If} $0 != “admin” ;Require admin rights on NT4+ MessageBox mb_iconstop “Administrator rights required!” SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED Quit ${EndIf} FunctionEnd Page InstFiles Section SectionEnd is the basic code I usually recommend to make sure … Read more

Detect if program is running with full administrator rights

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 AccessCheck Checking the TOKEN_ELEVATION* stuff in the token is not required for testing the current process but it is useful if you need to find out if the user … Read more

Run Java file as Administrator with full privileges

This answer is for those who are wiling to provide administrative privileges to their jars or java classes. After successfully developing an exe to edit files kept in admin. restricted directories, I have developed these steps to follow for you, hope this may help you: Things to understand: 1) Jars won’t be directly compiled with … Read more

How to start a new process without administrator privileges from a process with administrator privileges?

What you are trying to achieve cannot be done very easily and is not supported. However, it is possible using a modicum of hacking. Aaron Margosis wrote an article describing one technique. To quote the pertinent section, you will need to carry out these steps: Enable the SeIncreaseQuotaPrivilege in your current token Get an HWND … Read more

Admin rights for a single method

You can add a PrincipalPermission attribute to your method to demand administrative privileges for its execution: [PrincipalPermission(SecurityAction.Demand, Role = @”BUILTIN\Administrators”)] public void MyMethod() { } This is described in more detail in the following article: Security Principles and Local Admin Rights in C# .Net If you are looking for a way to elevate an already … Read more

Start / Stop a Windows Service from a non-Administrator user account

Below I have put together everything I learned about Starting/Stopping a Windows Service from a non-Admin user account, if anyone needs to know. Primarily, there are two ways in which to Start / Stop a Windows Service. 1. Directly accessing the service through logon Windows user account. 2. Accessing the service through IIS using Network … Read more