How to add a data using bigfix in hosts file

I want to add a data using bigfix in hosts file.
Please tell me how to add a data using bigfix in hosts file.

Thanks

I use something like this.

waithidden cmd.exe /C echo.{β€œ10.255.255.1 SMTP01”} >> {(pathname of system folder as string & β€œ\drivers\etc\hosts”)}

1 Like

Dear Mojea,

Thank you for your replay. I resolved my question.
I have one mote question.

After I check the input parameter in hosts file, I want to run this action.
Please tell me ih you have any ideas.

Thank you,

I apologize, but I am not sure that I understand your question.

Are you saying that you want to check the contents of the HOSTS file before you run the task/fixlet and if the host does not exist in the HOSTS file, run the task?

OR
Do you mean you want an action prompt to type in a dynamic value (hostname and IP) in order to update the HOST file?

Dear Mojea,

After I check the parameter(β€œ10.255.255.1 SMTP01”) in hosts file, if the parameter(β€œ10.255.255.1 SMTP01”) don’t exist in hosts file, I want to run this action.
Please tell me how you have any ideas.

And I ran a your answered action script on my Bigfix server and the result was fail.
Please help me.

Thank you,

You can use expression like
not exists lines whose(it contains "10.255.255.1" and it contains "SMTP01") of file "C:\windows\system32\drivers\etc\hosts"
as relevance in your task or fixlet.

1 Like