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: Security issues (Access Denied)

30 Nov 2012   #21
ChickPea57

Windows 7 Ultimate x64
 
 

I right-clicked on the file, selected properties and then the security tab, clicked "edit" and answered the UAC prompt, added myself explicitly to the security info, set "full control" and I can now edit the file with Notepad++

The temptation is to leave it like that, but I'll remove my access now I've achieved what I want.

I may create a little batch jpb to do this with CACLS.


Ah. It appears that CACLS is "deprecated", I should use ICACLS now.

Right:

I have two little batch files (you'd need to change this to use your favourite editor)

c:\utils\edithost.bat

Code:
icacls c:\windows\system32\drivers\etc\hosts /grant %username%:(F)
"C:\Program Files (x86)\Notepad++\notepad++.exe" c:\windows\system32\drivers\etc\hosts
c:\utils\savehost.bat
Code:
icacls c:\windows\system32\drivers\etc\hosts /remove %username%
You need to run this in a DOS session running elevated - I have a shortcut pinned to my start menu that starts the command shell, with "run as administrator" set. I've also changed the colours so it's obvious that it's the "all-powerful" version.

If there's a way to stall the CMD processing while the editor is active, this could all be done in a single batch file, removing the possibility of forgetting the save.


My System SpecsSystem Spec
.

Reply

 Security issues (Access Denied)




Thread Tools





Similar help and support threads
Thread Forum
Changing Setting Security on root folder returns 'access is denied'
Hi, Changing setting Security on root folder returns access is denied for some sub-folders. I have an external HHD assigned with 'G' driver letter under my Computer. I have removed 'everyone' from the 'Groups and user names' on the root folder by choosing 'security tab' from the property...
Backup and Restore
Security & Permissions Too good? - Error 5 Access is denied.
My not quite 3 months old Win 7 system has taken a notable dislike to me trying to install programs now that I have an actual need to burn some disks of the data and DVD kind. For certain programs I am getting that lovely little message box which states; "Unable to execute file in the temporary...
Software
Cannot start Windows Security Center Services. Error 5 access denied
I had trouble updating the MSE definitions a couple of days ago and I tried everything to get it to update, something about no connection. I gave up and uninstalled MSE completely using Revo. From Microsoft's web site, I downloaded and installed the newest version of MSE and the definitions updated...
System Security
Win 7 - Local Security Policy, Access Denied
Norton/Symantec, in its ever-ibimitable wisdom installs its Internet Security and Utilities packages into a locked folder(s). By locked I mean that one CANNOT modify (Rename, Delete, etc) the installed folder(s) and any of its sub-objects. I AM an administrator user, so I SHOULD (expect to) have...
General Discussion
Access denied and user privileges issues
Hi, I am experiencing weird issues with my Windows 7 64bit Pro installation. Some, but not all, programs won’t start, giving me a “The application was unable to start correctly 0xc0000022 click ok to close the application” error. It seems that 0xc0000022 is linked to some kind of access denied...
BSOD Help and Support
Software won't install and "access denied" issues
After I happily switched back to XP for a while, I was forced to do something, because my XP system partition gave me a lot of grief with the infamous events 51 and 9 and the day before yesterday I virtually stumbled from one BSOD to the next, while preparing a new 7 install on a different hd. I...
Software

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 00:04.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App