public void CopyFileFromGuestToHost(string guestPath, string hostPath, string exclude) { switch (_copyMethod) { case CopyMethod.network: string guestRootPath = Path.GetPathRoot(guestPath); MappedNetworkDriveInfo mappedNetworkDriveInfo = new MappedNetworkDriveInfo(guestRootPath); mappedNetworkDriveInfo.Username = _username; mappedNetworkDriveInfo.Password = _password; mappedNetworkDriveInfo.Auto = false; ConsoleOutput.WriteLine(" Mapping 'Remote:{0}' as '{1}'", mappedNetworkDriveInfo.RemotePath, _username); if (!_simulationOnly) { using (MappedNetworkDrive mappedNetworkDrive = new MappedNetworkDrive(_vm, mappedNetworkDriveInfo)) { string guestNetworkPath = mappedNetworkDrive.GuestPathToNetworkPath(guestPath); string guestNetworkRootPath = mappedNetworkDrive.GuestPathToNetworkPath(guestRootPath); ConsoleOutput.WriteLine(" Resolving 'Remote:{0}'", guestNetworkRootPath); mappedNetworkDrive.MapNetworkDrive(); ConsoleOutput.WriteLine(" Copying 'Remote:{0}' => '{1}'", guestNetworkPath, hostPath); CopyFiles(guestNetworkPath, hostPath, exclude); } } break; case CopyMethod.vmware: default: ConsoleOutput.WriteLine(" 'Remote:{0}' => '{1}'", guestPath, hostPath); if (!_simulationOnly) { _vm.CopyFileFromGuestToHost(guestPath, hostPath); } break; } }