2014-03-14 17:51:00 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module GuestWindows
|
|
|
|
module Cap
|
|
|
|
module ChangeHostName
|
|
|
|
def self.change_host_name(machine, name)
|
|
|
|
# On windows, renaming a computer seems to require a reboot
|
|
|
|
machine.communicate.execute(
|
|
|
|
"wmic computersystem where name=\"%COMPUTERNAME%\" call rename name=\"#{name}\"",
|
2014-05-22 16:35:12 +00:00
|
|
|
shell: :cmd)
|
2014-03-14 17:51:00 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|