0

How can I rename a file in a system folder on Windows 7?

I tried RequestExecutionLevel admin directive, but it does not work. I cannot rename file even manually - there are no change permissions for Administrators. First you must change file owner, update permissions and only then you can rename a file.

What will be the command to change the file owner to Administrators? (or, is there another way to rename a file in a system folder on Windows 7?)

Related question: https://superuser.com/questions/777134/windows-7-kiosk-turn-off-screen-keyboadr-autostart

Community
  • 1
  • 1
Michael Zelensky
  • 2,012
  • 3
  • 29
  • 37

1 Answers1

1

If there is some setting in the Control panel that toggles the OSK autostart then finding the registry setting for that is probably the best option. Try Process Monitor or RegShot.

Another alternative is adding something that runs at startup and kills osk.exe. Something as simple as a shortcut that executes taskkill.exe can be enough.

Renaming a system file is not something that I would recommend and to do it you would have to use the AccessControl plugin to change ownership etc.

Anders
  • 97,548
  • 12
  • 110
  • 164
  • Thanks for this info, I already tried procmon and there is another place in the registry that can be changed: this is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Accessibility\ATs\osk. I am trying to change this section registry keys, but it also requires some poweruser permissions. So the question now is how to change this registry section keys. – Michael Zelensky Jul 06 '14 at 14:03
  • 1
    AccessControl::SetRegKeyOwner + AccessControl::GrantOnRegKey but I would try to avoid doing this because it feels dirty messing with the system like this (IMHO). http://msdn.microsoft.com/en-us/windows/bb879984.aspx does not say these things run at startup as far as I can see... – Anders Jul 06 '14 at 15:03
  • Thanks, Anders! I totally agree with you, but after two days of comprehensive research it seems that this is the only way (except file renaming). I believe that you can do such things with caution if you understand what you are doing. Can you give code example for AccessControl::SetRegKeyOwner + AccessControl::GrantOnRegKey? Is there a way to make the current user (without knowing the name) the owner? – Michael Zelensky Jul 06 '14 at 16:20
  • 1
    http://stackoverflow.com/a/15397451 and the readme that ships with the plugin. To get the current user you can use AccessControl::GetCurrentUserName. – Anders Jul 06 '14 at 16:37
  • It doesn't work. Return values are 'ok', but the registry in fact doesn't update. – Michael Zelensky Jul 07 '14 at 18:57