Unable to Set new Ownership on Hosts.

scrt

New Member
Messages
5
Hi,
System: Windows 8.1

Objective: Trying to edit Hosts file.

Preparation:

  1. Made extension available for viewing.
  2. Made hidden file available for viewing.
  3. Run Notepad as administrator.
  4. Right Click on Hosts, select Properties. In security, I allow myself as administrator to have all privilege.

Cannot edit host file to save my changes with information provided from a site with above preparation.
Doing more web surfing, I discover Ownership is System and I need to change.
Did as site suggested to make myself, administrator, to have ownership and got "Unable to set new owner on Hosts. Access is denied".

Thank you for your help. So much hoop jumping to edit Hosts and still unable, what did I miss?. Again, tx for your help in advance.
 

My Computer

System One

  • OS
    windows 8.1
Right Click Host file, Properties, Security,Advanced, this is where you will find the change ownership I have mine changed to my local account primary User with admin.
 

My Computer

System One

  • OS
    Windows 8.1 Pro MC
    Computer type
    Laptop
    System Manufacturer/Model
    Asus G75VW / Z97 Pro
    CPU
    Intel Core i7-3610QM / I7-4790K
    Motherboard
    Z97 Pro
    Memory
    16 GB Hyundai HTM315156CFR8C-PB PC3-12800
    Graphics Card(s)
    nVIDIA GeForce GTX 670M (GF114M)
    Sound Card
    VIA 6.0.10.1600
    Screen Resolution
    1080
    Hard Drives
    Samsung 850 Pro 256, Samsung 850 Pro 1TB
    Internet Speed
    30 down 3 up
    Browser
    Explorer 11
    Antivirus
    NIS and Malwarebytes
I have a little batch file named xhosts.bat:

@echo off
%homedrive%
cd %windir%\system32\drivers\etc
attrib -s -h -r hosts
Rem notepad hosts
x hosts
attrib +s +h +r hosts

The attrib is the critical part.
 

My Computer

System One

  • OS
    Windows 10 Pro X64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Lenovo IdeaCenter K450
    CPU
    Intel Quad Core i7-4770 @ 3.4Ghz
    Motherboard
    Lenovo
    Memory
    16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
    Graphics Card(s)
    Intel Integrated HD Graphics
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    HP h2207
    Screen Resolution
    1680x1050@59Hz
    Hard Drives
    250GB Samsung EVO SATA-3 SSD;
    2TB Seagate ST2000DM001 SATA-2;
    1.5TB Seagate ST3150041AS SATA
    PSU
    500W
    Keyboard
    Wired USB
    Mouse
    Wired USB
    Internet Speed
    3GB Up, 30GB Down
    Browser
    SeaMonkey
    Antivirus
    Windows Defender; MBAM Pro
    Other Info
    UEFI/GPT
    PLDS DVD-RW DH16AERSH
Response to Windows 8.1 new Ownership change

Thank Clintlgm and Ztrucker for your reply.

Clintlgm: Try that prior to my SOS. When into properties, security, advance, etc ( cannot recall details from that web site solution -advance, find, selected admin. It changed for I can see the new ownership to be me but when I try to apply and to OK, that is when I decided to post.

Ztrucker: Will try your batch solution to change attribute and hope it will work.

Just to let people reading this post on Windows 8.1 host file changes, all my web surfing from various site did not give complete or proper solution for 8.1. Only discover ownership changes later on and I hope attributes changes by ztrucker will work. It is a bummer on Windows being so drastic, it should mention properly for we do want to change host file.

Side note: Forgot to mention that some site mention to tell defender not to monitor host file change. I do not use defender, it is disable, and thus not relevant. But being so desperate prior to initial help. I activated defender and told it not to monitor host file. LOL, window 8.1 does not make going back to my prior anti-virus software easy. For in the past u select which anti-virus to use. It looks like I have to do the uninstall and reinstall routine especially when my anit-virus is install and I cannot select. Yes, I am aware we dislike having two anti-virus running. Yes, I cannot find how to select or disable which anti-virus to use. As I said, I have to resort to re-install routine. And u need to be online for help and pity the poor souls who have to rely on Norton when they just got there computer from the store (pre-installed software, internet to get a good virus program, internet again for help when offline virus help should be mandatory - Windows has no offline help on important security).
This posting is made while on lunch run, hurry, to respond to above reply. tx
 

My Computer

System One

  • OS
    windows 8.1
Typically when you install an anti-virus program it disabled the built-in Windows Defender.
There is no select which one you want, never has been that I'm aware of.

Also, you should not have to change ownership to edit the hosts file, just the attributes.
 

My Computer

System One

  • OS
    Windows 10 Pro X64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Lenovo IdeaCenter K450
    CPU
    Intel Quad Core i7-4770 @ 3.4Ghz
    Motherboard
    Lenovo
    Memory
    16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
    Graphics Card(s)
    Intel Integrated HD Graphics
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    HP h2207
    Screen Resolution
    1680x1050@59Hz
    Hard Drives
    250GB Samsung EVO SATA-3 SSD;
    2TB Seagate ST2000DM001 SATA-2;
    1.5TB Seagate ST3150041AS SATA
    PSU
    500W
    Keyboard
    Wired USB
    Mouse
    Wired USB
    Internet Speed
    3GB Up, 30GB Down
    Browser
    SeaMonkey
    Antivirus
    Windows Defender; MBAM Pro
    Other Info
    UEFI/GPT
    PLDS DVD-RW DH16AERSH
Ownership or Attribute to change host file windows 8.1

Response to Clintlgm and Ztrucker

Clintlgm: Posted on how I try to change Ownership.
In Properties/security/advance, I see the following:

Type: Allow (Principal: Admin) Access: Full Control
In ownership, I see system and I click change.

I am then given Select User Group, I select Advance, Find now, and I selected the admin group.
I see the ownership belong to admin but when I try to apply and to ok, then I get the access deny for me to post for help.

Ztrucker: In desktop, I created host.bat with your suggestion. I ran it in desktop by clicking on host.bat.
I also went to command prompt and traverse to hosts. I did the attrib +r etc. I see I have archive (according to my friend that is what a stands for). I tried to change hosts and no luck. My friend surprise that changes did not work when I insisted to look at hosts to see if I had changes. My friend decided to go into command prompt and to do attrib of -r and concluded I have a system problem to change hosts.

Bottom line, I am trying to change hosts and I have gotten two school of thought. To change ownership and I cannot change ownership. To change attrib and I cannot save my hosts change. Any suggestion appreciated and will try. Tx

Side note:
Anti-virus: Cannot recall Vista, 7, etc. U could have a couple of anti working for it is software. But it is advice not for slowing computer or computer problem. You can select which. In windows 8.1, I have to reinstall my anti-virus in order to select and to remove defender. (time to find that software from my portable and to install when it is already install)
 

My Computer

System One

  • OS
    windows 8.1
You can only edit the hosts file when opening the edit program as administrator as far as I know.

In the thread of my last BSOD, you can find that I've modified the hosts file. I could only do that by opening the editor program as administrator, but I have never taken over the ownership.
 

My Computer

System One

  • OS
    Windows 10 Pro
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Custom build
    CPU
    i5-6500 @3.20GHz
    Motherboard
    Gigabyte B150-HD3P-CF
    Memory
    16GB DDR4 2133 Crucial Ballistix Sport LT
    Graphics Card(s)
    MSI GeForce GTX 1060 GAMING X 6G
    Sound Card
    Built-in
    Monitor(s) Displays
    Liyama ProLite XB2483HSU-B2
    Screen Resolution
    1920 x 1080
    Hard Drives
    Crucial MX200 500GB & Toshiba DT01ACA300 3TB
    PSU
    Corsair RM550x
    Case
    Fractal Design Define S
    Cooling
    Cooler Master TX3 i
    Keyboard
    Func KB-460 (MX Red)
    Mouse
    Corsair Gaming M65 RGB
    Browser
    Google Chrome
    Antivirus
    Bitdefender Total Security 2017 + MBAM Pro + MBAE Pro
    Other Info
    Creative Sound Blaster Tactic3D Rage V2 headset
You need to modify the batch file to comment out the x hosts line and uncomment notepad hosts line.

@echo off
%homedrive%
cd %windir%\system32\drivers\etc
attrib -s -h -r hosts
notepad hosts
Rem x hosts

attrib +s +h +r hosts

I use the X2 editor (the X above) but you wouldn't have that so use notepad. I should have made that change in the original one, sorry.

If you make that change, what happens when you run xhosts.bat (I don't like calling it hosts.bat for some reason).
It should open the hosts file in notepad, allow you to make changes then Ctrl+S to save it. When you close the notepad window
the attributes are reapplied to the hosts file.
 

My Computer

System One

  • OS
    Windows 10 Pro X64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Lenovo IdeaCenter K450
    CPU
    Intel Quad Core i7-4770 @ 3.4Ghz
    Motherboard
    Lenovo
    Memory
    16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
    Graphics Card(s)
    Intel Integrated HD Graphics
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    HP h2207
    Screen Resolution
    1680x1050@59Hz
    Hard Drives
    250GB Samsung EVO SATA-3 SSD;
    2TB Seagate ST2000DM001 SATA-2;
    1.5TB Seagate ST3150041AS SATA
    PSU
    500W
    Keyboard
    Wired USB
    Mouse
    Wired USB
    Internet Speed
    3GB Up, 30GB Down
    Browser
    SeaMonkey
    Antivirus
    Windows Defender; MBAM Pro
    Other Info
    UEFI/GPT
    PLDS DVD-RW DH16AERSH
Code:
@echo off
%homedrive%
cd %windir%\system32\drivers\etc
attrib -s -h -r hosts
notepad hosts
Rem x hosts
attrib +s +h +r hosts

Thanks for your response ztucker. In the above quote code, I name it xhost.bat and ran it in my desktop. After running the above, I am given the hosts and open in notepad. I made changes and did the CTRL S. I notice the save path to be desktop. Thus, I went to Save As and traverse to the hosts in ... system32/drivers/etc/hosts and try to do the save to affect the hosts.
I am given a message of Access denied - c: windows/system32/drivers/etc/hosts in command prompt.
tx

Axe0: Thank your your reply and I agree with you that an editor must be run as administrator to change hosts. I did all of those in preparation and thus conclude there is more than what I have seen in blogs. LOL, unsigned drivers is an issue in windows 8.1 and had some problem with public domain software. The cost to get a sign driver by MS. So, if users have problem with a software, keep in mind of windows 8.1 installation of drivers (unsigned drivers are not install and need a special method to install - surf on how to install unsigned drivers). It been ages since I play with wamp and in my case with PHP. tx
 

My Computer

System One

  • OS
    windows 8.1
This is the Security setting for my hosts file:

Hosts.jpg
 

My Computer

System One

  • OS
    Windows 10 Pro X64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Lenovo IdeaCenter K450
    CPU
    Intel Quad Core i7-4770 @ 3.4Ghz
    Motherboard
    Lenovo
    Memory
    16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
    Graphics Card(s)
    Intel Integrated HD Graphics
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    HP h2207
    Screen Resolution
    1680x1050@59Hz
    Hard Drives
    250GB Samsung EVO SATA-3 SSD;
    2TB Seagate ST2000DM001 SATA-2;
    1.5TB Seagate ST3150041AS SATA
    PSU
    500W
    Keyboard
    Wired USB
    Mouse
    Wired USB
    Internet Speed
    3GB Up, 30GB Down
    Browser
    SeaMonkey
    Antivirus
    Windows Defender; MBAM Pro
    Other Info
    UEFI/GPT
    PLDS DVD-RW DH16AERSH
Ztucker, thank you for taking the time to reply and also the time to post an image of the security detail. In your security detail photo, I have the same privileges. In post #6, I tried to humbly mention with Type: Allow, (Principal: Admin), Access: Full Control.

Post #9 correction, when I click on xhost.bat in my desktop, access denied is shown in command prompt and hosts is open in notepad. When I made changes and tried to save, I am given a message of file already exist and when I request to replace, I am given a small notebook msg box of access is denied.
I did not notice post the exact order of events for I was focus on the notebook editor when two action boxes were open (notebook and command prompt) and I thought command prompt window was shown when I did the save. Bottom line, access is denied.

Side note: I turn off the internet and ran lock hunter to see if there is a process using hosts. I see a msg stating that no process is holding or locking this file. Also, I turn off my internet when I performed ztucker xhost.bat . I am offline just trying any ideas that can stop me from editing hosts . My friend said I am in admin mode since I ran notebook as admin and no complaints. I am running out of solutions of why I am being denied access.. tx
 
Last edited:

My Computer

System One

  • OS
    windows 8.1
Re you running the batch file from a Elevated Command Prompt? If not, try it.

Press Window key + X, select Command prompt (Admin ) or something like that.

Run the batch file.
 

My Computer

System One

  • OS
    Windows 10 Pro X64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Lenovo IdeaCenter K450
    CPU
    Intel Quad Core i7-4770 @ 3.4Ghz
    Motherboard
    Lenovo
    Memory
    16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
    Graphics Card(s)
    Intel Integrated HD Graphics
    Sound Card
    Realtek HD Audio
    Monitor(s) Displays
    HP h2207
    Screen Resolution
    1680x1050@59Hz
    Hard Drives
    250GB Samsung EVO SATA-3 SSD;
    2TB Seagate ST2000DM001 SATA-2;
    1.5TB Seagate ST3150041AS SATA
    PSU
    500W
    Keyboard
    Wired USB
    Mouse
    Wired USB
    Internet Speed
    3GB Up, 30GB Down
    Browser
    SeaMonkey
    Antivirus
    Windows Defender; MBAM Pro
    Other Info
    UEFI/GPT
    PLDS DVD-RW DH16AERSH
Back
Top