NPS Hosts Manager

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
Lateralus138
Posts: 49
Joined: 30 Aug 2015, 20:52
Location: Decatur, IL.
Contact:

NPS Hosts Manager

14 Apr 2018, 18:43

I know there are other hosts file managers out there, and you probably all have your own methods, but recently some of my family members needed a tool to help manage theirs and since they are not trusting of other peoples software/scripts and come to me for advice I figured I'd build something of my own. I thought it came together pretty well so I thought I would post it here.

NPS Hosts Manager is a light-weight Windows hosts file manager that can backup, replace, restore to default, edit¹ (open in notepad only, what I mean by "light-weight"), and change the Read/Write mode on the fly.
¹ - Didn't see a need to build a built-in editor as the people originally meant to use this didn't need anything like syntax highlighting (not that there is any) or hosts resolving. This is what I mean by light-weight.
  • - Backup
    • - To any file and/or directory, but defaults to: C:\Windows\System32\drivers\etc\hosts_<date & time>.bak.
      - Quick way to make specific hosts files for specific needs (My family needs to block porn :o ).
    - Replace
    • - Replace current hosts file (with one of those backups? :P ).
    - Restore
    • - Restores to the current Windows default hosts file.
      - most here probably know that's essentially empty with commented Microsoft messages.
    - Edit
    • - Opens the current hosts file in notepad.
      - Will open in Read/Write mode and as administrator, but will change back if it was Read Only to begin with after "hosts - Notepad" closes.
    - RW - Mode
    • - Change the Read/Write mode of the hosts file on the fly
Most features here will control the file as admin and in Read/Write mode and will change the file back when done. And even if it doesn't for some reason you can see the status and change its' state quickly anyway.

Sorry, this is only in English, but of course you can branch it from GitHub and do almost anything you want with it. I don't really care, I just hope somebody gets good use out of it or maybe use of some of the code. Nothing to sell, just free for use :D
I wrote most of the code here, though if you see code of someone else I will gladly give credit where credit is due if you let me know who wrote it, of course :D
and let me know if something doesn't work for you. Only tested on Windows 10 64 bit.
Of course, SB_SetProgress() is from here: http://www.autohotkey.com/forum/topic37754.html

I did design the associated program icon in the executables.
Image

Check out the project:
Release page (executables in Current Release section): https://lateralus138.github.io/NPS-Hosts-Manager/
GitHub Repository: https://github.com/Lateralus138/NPS-Hosts-Manager

Screenshot:
Image
Attachments
Capture.PNG
Capture.PNG (56.8 KiB) Viewed 669 times

K̴̡̛̻̮̼͕̬̑̋̀̂͆͛̍̑͢ȩ̮̞͍̩̯̋̈͒͌̕ę̶͓̗͖͔̹̪͗̂̈͛̓͘p̠͉̙̟̒̊͌̐͘͘͟͡͞ S̸͖̖̮̞̥͇̖̓̌͛̽̿̓̊̓̾̚͜w͇̮͓̱͇̘̯͆̓͑̋̇̉͜͝i̢͔̝̳̻̱̋̾͐̾͗͊̀̕͜͡͡n̷̡͔̦̤̝̼̩̎͌̈́̀͛̄͆̎͠ǵ̸̘̝̭̦̠̗͖͌͐͑̑̿̅̈͜͜ḯ̡̬̥̙̩̼̪̑͆̿̌́n̛̼͎̲̬͇̲͉̗̞͊̓̃̂̈͝g̸͕̜͖̪͉͔̩̓̃̀̃͌̑̋̕͘.̪̜̜̜̯̂͂̈́͛̆͗̇̍̇.̟͔͍̙̜̫̗̂̿͛͋͋̈́̾̾̿͑.̡̣̟̝̭͉̦̪́̓̀͛̑̓̐̈͘͘

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 154 guests