No control over Windows Folder with admin, from 7 or XP


  1. Posts : 6
    Windows 7 Build 7000, Windows XP Home, Ubuntu 9.04
       #1

    No control over Windows Folder with admin, from 7 or XP


    This is my first post here, so I'm expecting to make a fool of myself, as I normally do.

    I want to replace a file in the windows folder. "notepad.exe" to be precise. I hate having to use an external program everytime I want to edit *nix and source files (no line returns, no syntax highlighting, etc.), so use that program 7 calls for Notepad.

    So my plan WAS to simply replace (Microsft's) "notepad.exe" with Notepad2 (from Flo's Freeware).

    I used the Super User account using "net user Administrator /active:yes".
    Unfortunately, I still don't have the permissions to do that! I guess I was getting my hopes up by guessing Administrator was going to be the same as Linux's root user. Obviously not.

    No worries, I thought. I've still got XP on the other HDD, I'll just pop on that. Execpt, XP Explorer will not let me replace the files either! File is protected. Nothing I can do.

    Apart from installing Ubuntu onto one of my memory sticks, loading that and forcing that damn file on top of the other one, can anyone tell me what is restricting me to as I please?
      My Computer


  2. Posts : 4,364
    Windows 11 21H2 Current build
       #2

    Hi, mynameiszanders, and welcome to the forums.

    I personally use notepad++, but rather than trying to replace the original notepad I simply associated all the different files types I want edited in Notepad++ directly (.sh files, .c files, .h files, etc) so that they would automatically open in Notepad++. I actually took over the associations for .txt and .log as well, and now Notepad++ opens whenever I open any of these file types.

    Does Notepad2 offer file association as well? Your best bet would be to do it that way, because I suspect the system is actively monitoring for file replacements as that is a known malware technique for hiding themselves from scrutiny....

    One thing you could try is to temporarily disable Windows Defender and see if that allows you to replace is if you're set on replacing the program as opposed to the file associations....
      My Computer


  3. Posts : 6
    Windows 7 Build 7000, Windows XP Home, Ubuntu 9.04
    Thread Starter
       #3

    File association is the method I am using at the moment. I works, at least.
    The other reason, which I forgot the mention, is that the few times that I actually use Internet Explorer (to test website development) I view the source.

    Thanks for the quick reply, it made me come down to earth! I know I don't need to replace the file when file association works just fine. I suppose I'm just stubborn when I get an idea in my head :P

    At least we know the new Windows system is secure, even through another OS accessing the filesystem! Well done Microsoft... and I think that's the first time I've said that in a very long time!

    Cheers, mniz.
      My Computer


  4. Posts : 1,009
    Windows 7 RC 7100 32bit/64bit
       #4

    mynameiszanders said:
    This is my first post here, so I'm expecting to make a fool of myself, as I normally do.

    I want to replace a file in the windows folder. "notepad.exe" to be precise. I hate having to use an external program everytime I want to edit *nix and source files (no line returns, no syntax highlighting, etc.), so use that program 7 calls for Notepad.

    So my plan WAS to simply replace (Microsft's) "notepad.exe" with Notepad2 (from Flo's Freeware).

    I used the Super User account using "net user Administrator /active:yes".
    Unfortunately, I still don't have the permissions to do that! I guess I was getting my hopes up by guessing Administrator was going to be the same as Linux's root user. Obviously not.

    No worries, I thought. I've still got XP on the other HDD, I'll just pop on that. Execpt, XP Explorer will not let me replace the files either! File is protected. Nothing I can do.

    Apart from installing Ubuntu onto one of my memory sticks, loading that and forcing that damn file on top of the other one, can anyone tell me what is restricting me to as I please?
    I believe that the system is secure for normal users, but as an administrator you can bypass some default security...

    So, if you want to replace the notepad.exe file, you will probably first need to take ownership of the file with the following commands:

    Open CMD with administrator rights and type:

    takeown /f c:\windows\notepad.exe
    takeown /f c:\windows\system32\notepad.exe

    icacls c:\windows\notepad.exe /grant your_user_name:F
    icacls c:\windows\system32\notepad.exe /grant your_user_name:F

    The above should let you do whatever you want with notepad.exe .
      My Computer


  5. Posts : 623
    vista x64/ win 7 x64
       #5

    limneos said:
    I believe that the system is secure for normal users, but as an administrator you can bypass some default security...

    So, if you want to replace the notepad.exe file, you will probably first need to take ownership of the file with the following commands:

    Open CMD with administrator rights and type:

    takeown /f c:\windows\notepad.exe
    takeown /f c:\windows\system32\notepad.exe

    icacls c:\windows\notepad.exe /grant your_user_name:F
    icacls c:\windows\system32\notepad.exe /grant your_user_name:F

    The above should let you do whatever you want with notepad.exe .
    Easier is adding this to the registry:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\*\shell\runas]
    @="Take Ownership"
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\*\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"

    [HKEY_CLASSES_ROOT\Directory\shell\runas]
    @="Take Ownership"
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"

    It'll put a take ownership in the rightclickmenu
      My Computer


  6. Posts : 6
    Windows 7 Build 7000, Windows XP Home, Ubuntu 9.04
    Thread Starter
       #6

    limneos said:
    I believe that the system is secure for normal users, but as an administrator you can bypass some default security...

    So, if you want to replace the notepad.exe file, you will probably first need to take ownership of the file with the following commands:

    Open CMD with administrator rights and type:

    takeown /f c:\windows\notepad.exe
    takeown /f c:\windows\system32\notepad.exe

    icacls c:\windows\notepad.exe /grant your_user_name:F
    icacls c:\windows\system32\notepad.exe /grant your_user_name:F

    The above should let you do whatever you want with notepad.exe .
    Worked a treat! Thankyou very much limneos!

    That is great, except I have to apologise to everyone who helped because, just now to check it works, I found out that Internet Explorer 8 has its own source viewer, like Firefox, and no longer uses notepad!

    I feel like such a fool :P Although, at least this means I live up to my own expectations :P

    Thanks to petrossa, to a method which is no longer needed, but will be used, just because I'm curious I still haven't dived into the registry editor in 7, and this has given me a cover up excuse to ruin the system's stability by my inquisitive prying!
      My Computer


  7. Posts : 623
    vista x64/ win 7 x64
       #7

    mynameiszanders said:
    Thanks to petrossa, to a method which is no longer needed, but will be used, just because I'm curious I still haven't dived into the registry editor in 7, and this has given me a cover up excuse to ruin the system's stability by my inquisitive prying!
    no need to open regedit, just copy paste the text and save it in notepad as a .reg file. Clicking it will add it to your registry. Reboot and you have your menuentry.

    Works fine, it gives you Take Ownership to a file or a folder without problems.
      My Computer


  8. Posts : 124
    Dual boot XP Pro and Seven/7127
       #8

    johngalt said:
    I personally use notepad++, but rather than trying to replace the original notepad I simply associated all the different files types I want edited in Notepad++
    Interesting thread this, with some detailed answers. Good stuff.
    I just wanna say I use the freebie notepad++ with the same file association method as you johngalt.
      My Computer


  9. Posts : 124
    Dual boot XP Pro and Seven/7127
       #9

      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:02.
Find Us