Windows Vista和區域網路聊天的電腦

來源:互聯網
上載者:User

檢查運行Windows Vista和區域網路聊天的電腦引導設定檔通常可以為使用者解決引導有關的問題,提供很多有價值的資訊。類似引導分區、引導目錄,以及Windows目錄等資訊往往都對排除故障很有用,大多數情況下通過VBS指令碼擷取這些資訊需要花費很多時間。
區域網路聊天-www.freeeim.com
如果Windows Vista和Windows Server 2008無法正常啟動,則可以檢查引導設定檔是否出現錯誤;另外可以檢查啟動服務及其依存性。Windows中的一些服務依賴於其他服務、系統驅動程式和組件的載入順序。如果系統組件被停止或運行不正常,則依賴於它的服務會受到影響。

建立名為“DisplayBootConfig.ps1”指令碼讀取引導配置,其代碼如下:

param($computer="localhost", [switch]$help)

function funHelp()

{

$helpText=@"

DESCRIPTION:

NAME: DisplayBootConfig.ps1

Displays a boot up configuration of a Windows system

PARAMETERS:

-computer The name of the computer

-help prints help file

SYNTAX:

DisplayBootConfig.ps1 -computer WebServer

Displays boot up configuration of a computer named WebServer

DisplayBootConfig.ps1

Displays boot up configuration on local computer

DisplayBootConfig.ps1 -help

Displays the help topic for the script

"@

$helpText

exit

}

if($help){ "Obtaining help ..." ; funhelp }

$wmi = Get-WmiObject -Class win32_BootConfiguration `

-computername $computer

format-list -InputObject $wmi [a-z]*

該指令碼使用param語句定義了$computer和$help變數,前者的預設值為localhost。設定-help參數為switch,即在使用該參數時不需要提供額外資訊,並且使用Get-WmiObject cmdlet從Win32_BootConfiguration WMI類中擷取資訊。如果需要,可以將$computer變數中的值提供給-computername參數。這樣可以通過Get-WmiObject cmdlet串連到遠端電腦,最終將返回的management對象傳遞給Format-List cmdlet。使用範圍運算子(range operator)[a-z]*選擇字元開頭的屬性,以過濾報告中的所有系統屬性(因為系統屬性均以下畫線開頭)。

該指令碼的執行結果1所示。

 

Read more: PowerShell2.0之Windows排錯(一)啟動故障排錯 - 天行健@中國元素 - 部落格園 http://www.cnblogs.com/fuhj02/archive/2011/01/16/1937007.html#ixzz1BDVc3100

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.