Computer Hope
Software => Computer software => Topic started by: shrshr429 on July 03, 2009, 06:47:02 PM
-
I just want to add (example):
127.0.0.1 localhost
127.0.0.1 google.com
to my host file - windows\sytem32\drivers\etc\hosts
through cmd, how can i do this?
-
Why thru .cmd ? ?
Open it in Notepad and add the revisions.
-
take a look here
http://technet.microsoft.com/en-us/library/bb490982.aspx
>> is the append command so the output will always be written to the end of the file rather than overwriting. Just using > will overwrite the file each time.
syntax is "(command) >> windows\sytem32\drivers\etc\hosts.txt"
Or
"echo 127.0.0.1 localhost >> windows\sytem32\drivers\etc\hosts.txt"
"echo 127.0.0.1 google.com >> windows\sytem32\drivers\etc\hosts.txt"
-
Why thru .cmd ? ?
Open it in Notepad and add the revisions.
-
I want to make it into a batch file and autorun on a cd, its going to block known spyware websites.
-
Honestly, I have no idea what you're trying to do. Why on CD? Hosts file must be located in certain folder, not on CD.
-
Make a batch file that adds
# Start of entries inserted by Spybot - Search & Destroy
127.0.0.1 www.007guard.com
127.0.0.1 007guard.com
127.0.0.1 008i.com
127.0.0.1 www.008k.com
127.0.0.1 008k.com
127.0.0.1 www.00hq.com
127.0.0.1 00hq.com
127.0.0.1 010402.com
127.0.0.1 www.032439.com
127.0.0.1 032439.com
127.0.0.1 www.0scan.com
127.0.0.1 0scan.com
127.0.0.1 www.1000gratisproben.com
127.0.0.1 1000gratisproben.com
127.0.0.1 www.1001namen.com
127.0.0.1 1001namen.com
127.0.0.1 100888290cs.com
127.0.0.1 www.100888290cs.com
to the host file located in Windows\system32\drivers\etc\host
make that autorun on a cd.
-
Why does it have to run from some CD, not to go straight to Windows\system32\drivers\etc\?
-
Or why not make a .txt file and just save/copy it from a disk?
-
ok then lets look at this differently, if i had a file (hosts) on the cd, how can i replace that tifle with the host file on the computer through cmd. The reason i want to do it through cmd is so i can make a batch file so it can autorun right off the cd.
-
ok then lets look at this differently, if i had a file (hosts) on the cd, how can i replace that tifle with the host file on the computer through cmd. The reason i want to do it through cmd is so i can make a batch file so it can autorun right off the cd.
Your obsession with this technique seems quite odd. Is this just for your computer, or do you intend this CD to be used for many computers?
-
Other computers.
-
Lets change the question since this is confusing. I know how to delete a file through cmd, so if i delete the host file through cmd, what would be the script to move a file from a cd to the host file's location.
-
copy