how to delete local machine registry key? - c++

I need to delete some local machine registry keys, I tried all registry delete routines but the result is through admin account I cant do it. how can I set access rights of my application to system account using windows API routines???
I also used this routine RegDeleteKey but returned value 5 means access denied, I run my application under full admin rights
even manually open regedit with admin rights, I wont be able to delete local machine registry keys. for purpose I need system account rights.
i opened regedit with system account rights and i was able to delete local machine keys successfully. now i need to do this programmatically

You either need to run your application as an administrator (Run as administrator in the context menu of Explorer), or you need to add a manifest to your application, indicating that your application needs administrator rights. In the latter case, a UAC dialog will ask you for administrator credentials.

Related

Edit account privilige in apex

i can't edit users privileges in apex as below image, it show read only.
account screenshot
the privileges are:
User is a developer
Application Builder Access
SQL Workshop Access
Team Development Access
The user in question is an administrator, which includes all of the other privileges already. There's nothing more to assign, and you can't assign the other privileges individually unless you take away the administrator privilege first.

Prompt to restart a process for administrative privilege

I am the only user and admin of my computer. My account doesn't have password because the computer is located in a secret room. I want to restart a process as administrator.
I don't want to change manifest because it makes the process to run always on administrative privilege.
I want administrative privilege only when I need it.
Using functions CreateProcessWithLogon, LogonUser and command tool runas.exe is not appropriate for me because I have no password.
What can I do? Moreover when I run an application as administrator, it prompts but it doesn't ask for password. Is there any way to make such a prompt?
Moreover when I run an application as administrator,it prompts but it doesn't ask for password.Is there any way to make such a prompt?
It would ask you for the password if you attempted to run the application as administrator from user account with limited user rights (non-admin).
If you wish to run under admin rights only when you really need them, you should split your application to two parts: one part would run under limited rights, the other, only capable to do the administrative actions and nothing more, would be run only at need (so it should not "run away").

Create .exe in Qt with admin privilege

I've coded a programm that require to be run as an admin privileges. I'm aware that I can do that through going to property/Compatibility/Run as adminstrator in Windows but how can I do that if possible to make it programmatically, so that when launched programm automatically gained Adminstrator privilege level?
Yes, with an application manifest that requests admin privileges.
http://msdn.microsoft.com/en-us/library/bb756929.aspx
(This will still ask the user whether he wants that, of course. And if your account cannot have admin privileges, the user will also have to use Run As to choose a different account.)

Running ColdFusion as a specific user

On this page, it talks about Windows NT, 2000, XP and 2003. Fortunately, I have a Windows 7 machine.
The very first line says:
In User Manager for Domains, create a local user for the ColdFusion
service to log in as.
I don't see a "User Manager for Domains", so do they mean just "Add a new user"?
If it DOES mean that, can I use my own user account as the ColdFusion user, or should I specifically create a new account just for ColdFusion?
If you are creating a domain account it has to be created ON the domain - using user manager for domains connected to your domain controllers. If that's what you need then a sys admin has to help.
If you are doing a "local" user on a windows 7 I always end up hunting around for the right view of user manager before I get it right :) Here are the steps that I use:
Search from start and open the "user accounts" cpl.
Click on "Manage User Accounts"
Click on the "advanced" tab
Click on the "advanced" buttton.
This takes me to the mmc-like view of users that I'm accustomed to where I can add a user, change membership, set passwords etc.
Hope this helps :)
You can use your own username or you can create one for CF to run as. Creating a user to run CF as probably more closely replicates your production environment ( an assumption ) so if production for example writes to a UNC path the coldfusion user must have acces. You could
Mimic this locally.
You can use either an account local to the OS where ColdFusion is running, or a domain account if the OS is joined to a domain. In your case, you can just create a local user on your Windows 7 OS and run the ColdFusion Application Service as that user. The user account will need access to ColdFusion's installation folder, as well as read access to the webroot.
The whole idea is to run the ColdFusion service as a user with the minimum privileges necessary to handle requests and prevent access to other resources in the event of a data breach or remote code execution (e.g. someone exploits an upload form and manages to get their own CF code to run on your server; it's not pretty but can be somewhat restricted by running the CF service under a user account with restricted access).
As someone else mentioned, if CF needs access to other network resources, the user account will need to be granted access to those resources as well (either by using a domain account or having a local account with the same username and password on the remote system).
Just did this on Windows 2008 R2 with CF 10. The trick was to change the ownership of the c:\windows and c:\windows\system32 directories as outlined here.
change ownership from trustedInstaller

disable editing of registry key by other application

Can we disable editing for a specific registry key used by our application. I want only my applicaton to make changes into the registry and other cant see or edit them.
Yes and no.
The registry acts as any other file on the system. You can set specific access modifiers on each key. So if you set the access keys so that only a certain user can see/edit them that is what will happen. For that to work though, your program will have to run impersonated as that user.
If a user starts another program or regedit as the same user, he will also be able to modify/see that key.
An administrator will always be able to see/modify that key. Even if he's not the owner and the admin rights have been removed, he can still make himself owner again.