public void SetIP(string value)
        {
            if (value.Length < 7)
                throw new InvalidDataException("IP too short");
            Shell.ShellOutput output = new Shell.ShellOutput();

            LoginTools(true);
            Shell guestShell = new Shell(VM.VM); // TODO: mock?
            string cmd = "netsh interface ip set address " +
                AppConfiguration.GetNetworkInterfaceName() + " static " + value + " 255.255.255.0";
            output = guestShell.RunCommandInGuest(cmd);

            // Depending on OS, should print "Ok.\n\n" or not print any output if success
            if (output.StdOut.Length < 12)
            {
                return;
            }
            else if (output.StdOut.Contains("failed"))
            {
                throw new InvalidOperationException(cmd + "\n" + output.StdOut);
            }
            else
            {
                throw new InvalidProgramException(cmd + "\n" + output.StdOut);
            }
        }
        public void SetHostname(string hostname)
        {
            if (hostname.Length < 3)
                throw new ArgumentException("Hostname too short");
            Shell.ShellOutput output = new Shell.ShellOutput();

            LoginTools(true);
            var renameScriptHost = AppConfiguration.GetWebserverTmpPath() + "renamecomp.vbs";
            if (!File.Exists(renameScriptHost))
            {
                if (!Directory.Exists(AppConfiguration.GetWebserverTmpPath()))
                    Directory.CreateDirectory(AppConfiguration.GetWebserverTmpPath());
                //if (!File.Exists(renameScriptHost))
                //File.Create(renameScriptHost);
                File.WriteAllText(renameScriptHost, @"Set objWMIService = GetObject(""Winmgmts:root\cimv2"")
                        For Each objComputer in _
                            objWMIService.InstancesOf(""Win32_ComputerSystem"")
                            Name = WScript.Arguments.Item(0)
                            Return = objComputer.rename(Name,NULL,NULL)
                                If Return <> 0 Then
                                    WScript.Echo ""rename-fail, error = "" & Err.Number
                                Else
                                    WScript.Echo ""rename-succ""
                                End If
                        Next
                ");
            }

            //note: Host means Webserver, NOT VMware server
            if (!VM.DirectoryExistsInGuest(@"C:\temp"))
                VM.CreateDirectoryInGuest(@"C:\temp");
            if (!VM.FileExistsInGuest(@"C:\temp\renamecomp.vbs"))
                VM.CopyFileFromHostToGuest(renameScriptHost, @"C:\temp\renamecomp.vbs");

            Shell guestShell = new Shell(VM.VM); //TODO: mock?
            output = guestShell.RunCommandInGuest(@"cscript c:\temp\renamecomp.vbs " + hostname);
            //output = guestShell.RunCommandInGuest(@"cscript "+Config.getWebserverVMPath()+@"\renamecomp.vbs " + newName);

            if (output.StdOut.Contains("rename-succ"))
                return;
            else if (output.StdOut.Contains("rename-fail"))
                throw new InvalidOperationException(output.StdOut);
            else
                throw new InvalidOperationException(output.StdOut);
        }