Sha256: 1185a4933fa4305ae0aaf34da470b03a599cdfbef592e02d99f2e0b75a906ffc

Contents?: true

Size: 402 Bytes

Versions: 24

Compression:

Stored size: 402 Bytes

Contents

module VagrantWindows
  module Guest
    module Cap
      class 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}\"",
            :shell => :cmd)
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
vagrant-windows-1.7.0.pre.2 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-windows-1.7.0.pre.1 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-windows-1.6.0 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-plugin-dummy-0.0.7 windows/guest/cap/change_host_name.rb
vagrant-windows-1.6.0.pre.1 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-plugin-dummy-0.0.6 windows/guest/cap/change_host_name.rb
vagrant-plugin-dummy-0.0.5 windows/guest/cap/change_host_name.rb
vagrant-windows-1.5.1 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-windows-1.5.0 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-windows-1.4.0 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-windows-1.3.2 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-windows-1.3.1 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-windows-1.3.0 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-windows-1.3.0.pre.3 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-windows-1.3.0.pre.2 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-windows-1.3.0.pre.1 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-windows-1.2.3 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-windows-1.2.2 lib/vagrant-windows/guest/cap/change_host_name.rb
vagrant-plugin-dummy-0.0.4 windows/guest/cap/change_host_name.rb
vagrant-plugin-dummy-0.0.3 windows/guest/cap/change_host_name.rb