Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


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

19 Jan 2009   #1
mynameiszanders

Windows 7 Build 7000, Windows XP Home, Ubuntu 9.04
 
 
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 System SpecsSystem Spec
.
19 Jan 2009   #2
johngalt

 

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 System SpecsSystem Spec
19 Jan 2009   #3
mynameiszanders

Windows 7 Build 7000, Windows XP Home, Ubuntu 9.04
 
 

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 System SpecsSystem Spec
.

19 Jan 2009   #4
limneos

Windows 7 RC 7100 32bit/64bit
 
 

Quote   Quote: Originally Posted by mynameiszanders View Post
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 System SpecsSystem Spec
20 Jan 2009   #5
petrossa

vista x64/ win 7 x64
 
 

Quote   Quote: Originally Posted by limneos View Post
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 System SpecsSystem Spec
20 Jan 2009   #6
mynameiszanders

Windows 7 Build 7000, Windows XP Home, Ubuntu 9.04
 
 

Quote   Quote: Originally Posted by limneos View Post
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 System SpecsSystem Spec
21 Jan 2009   #7
petrossa

vista x64/ win 7 x64
 
 

Quote   Quote: Originally Posted by mynameiszanders View Post
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 System SpecsSystem Spec
21 Jan 2009   #8
anykey

Dual boot XP Pro and Seven/7127
 
 

Quote   Quote: Originally Posted by johngalt View Post
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 System SpecsSystem Spec
15 Feb 2010   #9
anykey

Dual boot XP Pro and Seven/7127
 
 

My System SpecsSystem Spec
Reply

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




Thread Tools




Similar help and support threads
Thread Forum
Users folder not visible in explorer,lock on admin's user folder icon?
A past virus must have caused this.The C:\Users folder is not visible in explorer for some reason.I can still visit the contents and the pc works fine,but this is not right.Also, there is a lock on my users/alexandros folder icon.Maybe it has something to do?
System Security
I am not able to access User Account Control on win 7 Pro using admin.
Unable to change User Account Control settings in Windows 7 I am unable to access my User Account Setting in Windows 7 when I click on it nothing comes up , even though I'm logged in as an administrator. When I click on "Change User Account Control Settings", absolutely nothing happens. I am...
System Security
How to delete windows admin user folder??
Ok so i have this problem. I had a problem with my admin account last night. When i tried to login it said that that the user profile could not be loaded. So i logged into the built in admin account and deleted that profile and created a new admin account. Now when i login to my new account, in...
General Discussion
UAC Admin Account Control
Afternoon all, Looking to see if anyone has any information about local admin control while on a domain. Basically we'd like to give our laptop users the ability to use UAC with a local administrative account, but we want to ensure that users (or anyone for that matter) do not have the...
System Security
unable to acces certain control panels from admin account
I am not sure when this issue occurred, but I noticed it today Problem: I am unable to acces certain CP from the admin account. These CP include "advanced system settings" and "remote setings". When clicked, nothing happens. So far all the unresponsive CP I have identified are "admin CP" (they...
General Discussion
Admin Control problem
Hello all. I have searched the forums the last hour or so and havn't yet found a solution to my problem, hoping it hasn't been asked elsewhere but here goes.. I am trying to install world of warcraft... the first game install's fine, then when I try and update it - an error occurs saying I...
Installation & Setup


Our Sites

Site Links

About Us

Find 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 09:57.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App