title: Rename a computer programmatically
body: <p>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:</p>
  
  <p>Command line<br>
  Java<br>
  Python<br>
  C# (would prefer one of the other 3, but this is ok)</p>
  
  <p>It would be helpful to learn how to do this on both Linux and Windows.</p>