Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hosts File Editor] Can't save hidden hosts file #34291

Open
chnjyxz opened this issue Aug 13, 2024 · 7 comments
Open

[Hosts File Editor] Can't save hidden hosts file #34291

chnjyxz opened this issue Aug 13, 2024 · 7 comments
Assignees
Labels
Issue-Bug Something isn't working Product-Hosts File Editor Refers to the Hosts file editor Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Status-Reproducible This issue was reproduced by a maintainer

Comments

@chnjyxz
Copy link

chnjyxz commented Aug 13, 2024

Microsoft PowerToys version

0.83.0

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

Hosts File Editor

Steps to reproduce

run program with administrator
edit any hosts in editor show can not save hosts file
but I can edit and save in notpad with administrator

✔️ Expected Behavior

PowerToysReport_2024-08-14-04-02-06.zip

❌ Actual Behavior

run program with administrator
edit any hosts in editor show can not save hosts file
but I can edit and save in notpad with administrator
QQ图片20240814040836

Other Software

No response

@chnjyxz chnjyxz added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Aug 13, 2024
Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@davidegiacometti davidegiacometti added the Product-Hosts File Editor Refers to the Hosts file editor label Aug 14, 2024
@davidegiacometti
Copy link
Collaborator

Hi @chnjyxz
Can you share a screenshot of the hosts file properties?
Does the file have read-only or hidden attributes set?
/needinfo

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Aug 14, 2024
@chnjyxz
Copy link
Author

chnjyxz commented Aug 14, 2024

5SY0JUFR B@HX%OJJ8HKS

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Aug 14, 2024
@chnjyxz
Copy link
Author

chnjyxz commented Aug 14, 2024

N3D10MDRN54R 5P3SO~`O

@davidegiacometti
Copy link
Collaborator

The editor fails to save the file due to the hidden attribute set on the hosts file.
First time we encounter this issue. I think we should handle it somehow.
Work-around is removing the hidden attribute from the hosts file.

@davidegiacometti davidegiacometti added Status-Reproducible This issue was reproduced by a maintainer and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up labels Aug 14, 2024
@davidegiacometti davidegiacometti self-assigned this Aug 14, 2024
@davidegiacometti davidegiacometti changed the title can not save hosts file with root [Hosts File Editor] Can't save hidden hosts file Aug 14, 2024
@davidegiacometti davidegiacometti added the Status-In progress This issue or work-item is under development label Aug 15, 2024
@davidegiacometti davidegiacometti added this to the PowerToys 0.84 milestone Aug 15, 2024
@chnjyxz
Copy link
Author

chnjyxz commented Aug 15, 2024

run C:\Windows\System32\drivers\etc>attrib -s -h -r hosts
it works! thank you!

@davidegiacometti
Copy link
Collaborator

Good to know that.
I have also created a PR to handle the hidden hosts file in the PowerToys Editor.

@stefansjfw stefansjfw added Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Status-In progress This issue or work-item is under development labels Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Product-Hosts File Editor Refers to the Hosts file editor Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. Status-Reproducible This issue was reproduced by a maintainer
Projects
Status: No status
Development

No branches or pull requests

4 participants