{Ask} batch to replace host

August 14th, 2013

Dear All
I need a batch to change host file in C:\WINDOWS\system32\drivers\etc with my other host file in one click, and if the host file existed is attribute read only or hidden, the batch will remove the attribute first.
I would be thanks full if anyone do me a favor to make that batch

Answer #1
erwanhammet replied: Dear All
I need a batch to change host file in C:\WINDOWS\system32\drivers\etc with my other host file in one click,

What other host file? What are you attempting to do? Replace the host file with another file?
and if the host file existed is attribute read only or hidden, the batch will remove the attribute first.
I would be thanks full if anyone do me a favor to make that batch

What Operating system are you using because that will affect things. Win 7 needs admin rights to make changes to hosts.
These are only a few prompts that will be needed if anyone else wishes to do it. You could find this info on google and DIY.
Answer #2
I mean, I create my own private host to open xxx site. I want to change the host in the windows with one click, I used windows xp sp 3. Can you give me the batch for that, many thanks before
Answer #3
you want to swap them back and forth or just one change ?
you just need to change the attributes once so do that manually
then just put the hosts files in folders with the batch file that says
copy /y hosts C:\WINDOWS\system32\drivers\etc\
that will overwrite the current one without a prompt
Answer #4
could you gimme the location of your other hosts file. it would be easier than writing the instructions on how you need to modify it for you.
edit: edwoodweb pretty sure he wants to do it a few times.
Answer #5
my other host file is in usb flashdrive
Answer #6
my other host file is in usb flashdrive
then put a copy of the batch file on there
and have a copy of the other hosts file and the batch in a local folder
then create shortcuts on the flash drive to both batch files

 

| Sitemap |