Deploying Hosts file to XP clients across the network

(imported topic written by sharad91)

Hi,

We have a requirement of replacing the Windows hosts file which is located in C:\WINDOWS\system32\drivers\etc for all the aclients in the network. This activity needs to be done every month. How can i do it using BIGFIX ?

The Software Distribution Wizard it supports only .exe or .msi files. How the task can be achieved, since for this activity we need to create .bat file or a script which will replace the existing hosts file.

Thanks

Sharad

(imported comment written by NoahSalzman)

How big is the hosts file? If it is under a few kilobytes the easiest way to do this would be with an ActionScript such as this:

parameter 
"hosts_file" = 
"{pathname of system folder}\drivers\etc\hosts" delete __appendfile delete 
"{parameter "hosts_file
"}"   appendfile # some commented text appendfile 192.168.1.1   bar.example.com appendfile 192.168.1.2   foo.example.com appendfile 192.168.1.3   baz.example.com   move __appendfile 
"{parameter "hosts_file
"}"

Edit: fix parameter syntax

(imported comment written by sharad91)

Hi,

Thanks for reply.

The host file is 5000kb, every month it is difficult to append the file, it is better to replace the hosts file.

Please suggest me how i can go ahead and complete the task.

Sharad

(imported comment written by NoahSalzman)

Hi sharad,

There are many examples in the Forum on how to download files from a central server and copy them to a desired location using Action Script. Here are a couple:

http://forum.bigfix.com/viewtopic.php?id=4146

http://forum.bigfix.com/viewtopic.php?id=4535

There is also a download example here: http://support.bigfix.com/bes/misc/customactions.html

Also, just to be clear, the “appendfile” command name is a little misleading. It is not appending data onto the existing hosts file. The example above will replace the existing hosts file with the data on the appendfile lines of that Action Script.

(imported comment written by sharad91)

Hi,

Thanks for the support.

I have done it using tools-> custom Action script. It worked successfully.

Thanks once again.

Sharad