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

Windows cmd scripts to change hosts permissions #43

Closed
wants to merge 1 commit into from

Conversation

tkdb
Copy link
Contributor

@tkdb tkdb commented May 9, 2014

I created two windows cmd scripts that can work together to change permissions for
the current user to modify the hosts file.

the first script win-hosts-check.cmd checks if the permissions on the file are sufficient. It can be called from it's directory.

If not it will call the second script win-hosts-set.cmd which will trigger the windows
permission dialog asking for enough rights to modify the permissions on
the hosts file for the current user.

See issue #40

Note 1: As those are supporting files I didin't know where to place them. So I create the cmd subdirectory. I don't know the correct convetions for those vagrant plugins with those.

Note 2: The principle on linux if the permissions are not enough is to sudo out a sed command. Those two script are not aligned with such a principle. Instead those work idempotent and the first script only needs to be called as it will take care to set permissions only if necessary.

Two windows cmd scripts that can work together to change permissions for
the current user to modify the hosts file.

win-hosts-check.cmd check if the permissions on the file are sufficient.

If not it will call win-hosts-set.cmd which will trigger the windows
permission dialog asking for enough rights to midify the permissions on
the hosts file for the current user.

See issue agiledivider#40
@tkdb
Copy link
Contributor Author

tkdb commented May 9, 2014

Tested on a windows 8 system. Should work on XP onwards.

@cgsmith cgsmith added this to the 0.13 milestone Nov 4, 2015
@cgsmith cgsmith modified the milestones: 0.13, 1.0.2 Dec 8, 2015
@cgsmith cgsmith closed this Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants