MSFN Forum: is there a way to add entries to the host file using wpi? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

is there a way to add entries to the host file using wpi? Rate Topic: -----

#1 User is offline   cworkman 

  • MadMan29729
  • Group: Members
  • Posts: 39
  • Joined: 07-October 05
  • OS:Vista Home x86
  • Country: Country Flag

Posted 17 August 2010 - 11:21 AM

is there currently a way to add entries to the hosts file on windows using wpi?


#2 User is offline   mritter 

  • WPI Co-Developer
  • Group: Developers
  • Posts: 1,088
  • Joined: 13-November 05

Posted 17 August 2010 - 06:22 PM

No. That would be done better in a batch file.

#3 User is offline   cworkman 

  • MadMan29729
  • Group: Members
  • Posts: 39
  • Joined: 07-October 05
  • OS:Vista Home x86
  • Country: Country Flag

Posted 17 August 2010 - 07:27 PM

well while i was waiting on a reply i made a custom solution!

if anyone else is interested here it is!

usage is as follows

to add an entry!
hosts.exe "/Add:74.208.10.249 gs.apple.com" "/Add:74.208.105.171 gs.apple.com"

to remove an entry!
hosts.exe "/Remove:74.208.10.249 gs.apple.com" "/Remove:74.208.105.171 gs.apple.com"

or mix & match
hosts.exe "/Add:74.208.10.249 gs.apple.com" "/Remove:74.208.105.171 gs.apple.com"


NOTE: requires .Net Framework 2.0
NOTE:this package adds the entries silently so you will not see any confirmation!
NOTE: this host file on windows vista is located @ C:\Windows\System32\drivers\etc\hosts
NOTE: if the hosts file on other versions of windows are located in a different location please let me know and i will add support!!

Attached File(s)

  • Attached File  hosts.zip (4.82K)
    Number of downloads: 15

This post has been edited by cworkman: 18 August 2010 - 05:59 AM


#4 User is offline   EneergE 

  • Newbie
  • Group: Members
  • Posts: 34
  • Joined: 06-May 06

Posted 14 October 2010 - 11:55 PM

Hmm, you could just use:

echo 127.0.0.1 bannedsite.com >> %windir%\system32\drivers\etc\HOSTS


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy