Anda di halaman 1dari 2

LANGKAH-LANGKAH : Terlebih dahulu anda harus membuat satu folder khusus untuk menyimpan file-file yang akan dibuat

nanti, karena file-file tersebut akan bekerja maksimal jika ber ada pada satu folder saja.

Mari kita buat file script .txt yang berfungsi sebagai Induk File Hosts untuk me mbuka dan memblokir facebook.

Buat file text dengan nama "open-hosts.txt" menggunakan aplikasi Notepad, isi fi le tersebut dengan kode : # Copyright (c) 1993-1999 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host 127.0.0.1 localhost

Buat file text dengan nama "block-hosts.txt" menggunakan aplikasi Notepad, isi f ile tersebut dengan kode : # Copyright (c) 1993-1999 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host 127.0.0.1 localhost 0.0.0.0 www.facebook.com

0.0.0.0 facebook.com 0.0.0.0 m.facebook.com 0.0.0.0 touch.facebook.com

Sekarang mari kita buat file script .bat yang gunanya untuk menginjeksikan Induk File tersebut pada file "c:\windows\system32\drivers\etc\hosts"

Buat file dengan nama "open.bat" menggunakan aplikasi Notepad, isi file tersebut dengan kode : copy /y open-hosts.txt c:\windows\system32\drivers\etc\hosts

Buat file dengan nama "block.bat" menggunakan aplikasi Notepad, isi file tersebu t dengan kode : copy /y block-hosts.txt c:\windows\system32\drivers\etc\hosts

Dengan ini maka kita telah membuat 4 file yaitu "open-hosts.txt","block-hosts.tx t","open.bat" dan "block.bat".

Cara menggunakannya cukup mudah : a. Double klik pada file "block.bat" untuk memblokir facebook. b. Double klik pada file "open.bat" untuk membuka facebook.

Dengan ini saya rasa artikel ini cukup mudah untuk dipelajari, dan semoga bisa m embantu anda. Note : Agar script untuk memblokir facebook berjalan pada saat komputer dihidupkan, mak a harus dibuat shortcut file "block.bat" pada folder startup. Anda juga bisa men gatur "Task Schedule" agar script ini bisa berjalan otomatis pada waktu-waktu te rtentu.

Anda mungkin juga menyukai