![]() ![]() PROBLEM 2: Why running as Administrator doesn't give me the permissions to create/edit keys in registry? I clicked it with RMB and choose "Run as Administrator" - the same! So: Why? I made a simple test and turned off the "-setup" switch - so the app should run "setup" without any commandline parameters. I finally ran it with RUNAS and there was exception thrown (catched). bat files with myapp.exe -setup and run them as Administrator, but it needed to have the whole path to the EXE, which is totally not portable. I mean, will every user need to run it from RUNAS /user:userName "myapp.exe -setup" ? Is there simplier method to do it (simple like RMB->Run as Administrator but with parameter)? check for corrupt Names, Remove any found - may have to take ownership first. > Permissions > Change Permissions > Add. REGISTRY PERMISSIONS RESET WINDOWS 7 HOW TOPROBLEM 1: How to easily run the app with commandline argument as an Administrator? After running SecEdit, I use Windows Explorer to open Computer, and one-by-one for each disk, confirm permission resets. ![]() OK, I caught it so I could inform user with MessageBox that he should run it as an Administrator. You can then use this information to review the permissions using regedit. When I did this, it threw an exception System.UnauthorizedAccessException. the key exists, it's checked elsewhere What I need to do is (in a short way): RegistryKey k = ("SOFTWARE\\something\\else") So I decided that my app should run "setup" when user starts it with a parameter. If youre trying to edit the registry on a remote computer, you can only use these shortcuts: HKLM and HKU. I wanted to make something like "setup" - on the user's demand, the app should fill the registry with default config values, which can be changed later. The main goal is it should be portable, I mean one EXE file. I made a small console application, which gets the parameters from the command line and makes some actions based on those parameters and the config from registry. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |