HostsEdit
v2.2
HostSedit เป็นยูทิลิตี้บรรทัดคำสั่งสำหรับการแก้ไขไฟล์โฮสต์ Windows สามารถใช้ในการแก้ไข (เพิ่ม/ลบ) รายการเดี่ยวหรือหลายรายการในไฟล์โฮสต์ นอกจากนี้ยังมีคุณสมบัติเพิ่มเติมบางอย่างในการสร้างการสำรองข้อมูลโฮสต์การกู้คืนไฟล์โฮสต์เป็น windows เริ่มต้นหรือเป็นการสำรองข้อมูลก่อนหน้าการเปลี่ยนแอตทริบิวต์ของไฟล์โฮสต์แทนที่ IPS ในไฟล์โฮสต์และล้างแคช Windows DNS HostSedit เขียนใน Delphi รวบรวมโดยใช้ Delphi 10.3.3 CE ของ Embarcadero
/a : Add single entry.
/r : Remove single entry.
/am : Add multiple entries, reading from text file.
/rm : Remove multiple entries, reading from text file.
/b : Create backup of HOSTS file.
/fdns : Flush Windows DNS Cache.
/rip : Replace IPs in HOSTS file.
/res : Restore HOSTS file to Windows default, or to a previous backup.
/attr : Set attributes for HOSTS file, ReadOnly(/attr r), Archive(/attr a), Both(/attr ra).
hostsedit /a 0.0.0.0 www.example-domain.com
hostsedit /r www.example-domain.com
hostsedit /am "D:HOSTS Entriesexample.txt"
hostsedit /rm "D:HOSTS Entriesexample.txt"
hostsedit /b "D:HOSTS.BKP"
hostsedit /fdns
hostsedit /rip 0.0.0.0 127.0.0.1
hostsedit /res
hostsedit /res "D:HOSTS.BKP"
hostsedit /attr r
#entries suitable for both adding/removing.
0.0.0.0 c3.zedo.com
0.0.0.0 c4.zedo.com
0.0.0.0 c5.zedo.com
0.0.0.0 c6.zedo.com
#entries suitable for removing alone.
c7.zedo.com
c8.zedo.com
Run CMD as Administrator(Important to receive execution results from hostsedit back to CMD),
using 'cd' command change working directory to where hostsedit.exe is placed,
now write commands as Shown in the Samples.
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:Windowssystem32>hostsedit /a 0.0.0.0 www.example-domain.com
Adding entry to HOSTS file...
Done.
C:Windowssystem32>hostsedit /r www.example-domain.com
Removing entry from HOSTS file...
Done.
//Edit Single Entry:
[Run]
Filename: "{app}hostsedit.exe"; Parameters: "/a 0.0.0.0 www.google.com"; Flags: runhidden;
[UninstallRun]
Filename: "{app}hostsedit.exe"; Parameters: "/r www.google.com"; Flags: runhidden;
//Edit Multiple Entries:
[Run]
Filename: "{app}hostsedit.exe"; Parameters: "/am ""{app}test.txt"""; Flags: runhidden;
[UninstallRun]
Filename: "{app}hostsedit.exe"; Parameters: "/rm ""{app}test.txt"""; Flags: runhidden;
สำหรับ Windows XP, Vista, 7, 8, 8.1, 10 (32 64 บิต)