I need to automate the changing of the hostname of a computer, but I can't figure out how to do it inside a program. My options are open; I would be happy with a solution in any of the following:
Command line
Java
Python
C# (would prefer one of the other 3, but this is ok)
It would be helpful to learn how to do this on both Linux and Windows.