|
WMI Fun !! 〜 WMIに興味がある方・システム管理者必見!! 〜 WMI StepWMI SampleWMI ReferenceWMI LibraryPersonalLinkAbout WMI Fun !! |
|
|
|
WMI Fun !! > WMI Sample (VB) > 一番最後に振られているドライブレター割当文字を取得する |
|
|
Panasonic Let'snoteを長年愛用しています、その理由はMy Let'snoteで…
インクを買うよりもしかしたら安い?インクジェット複合機HP Photosmart 5510 白いご飯や日本酒にもとても合うにしんのきりこみがマイブームです 一番最後に振られているドライブレター割当文字を取得する: Win32_BootConfiguration - WMI Sample (VB)Topics
一番最後に振られているドライブレター割当文字を取得するサンプルプログラムです。Win32_BootConfigurationクラスを使用します。
Sample Code
Private Sub Command1_Click()
Dim BtcSet As SWbemObjectSet Dim Btc As SWbemObject Dim Locator As SWbemLocator Dim Service As SWbemServices Dim MesStr As String Set Locator = New WbemScripting.SWbemLocator Set Service = Locator.ConnectServer Set BtcSet = Service.ExecQuery("Select * From Win32_BootConfiguration") For Each Btc In BtcSet MesStr = MesStr & _ "LastDrive:" & Btc.LastDrive & vbCrLf & vbCrLf Next MsgBox "一番最後に振られているドライブレター割当文字です。" & vbCrLf & _ vbCrLf & MesStr & "ですよ。" Set BtcSet = Nothing Set Btc = Nothing Set Service = Nothing Set Locator = Nothing End Sub
Comment
実行するとパソコン上一番最後に振られているドライブレター割当文字を取得します。
Recommended book
個人的にお勧めする本の紹介です。
|
|
ご意見・ご要望・ご感想をこちらのアンケートからお待ちしています |
| ∧ ページの先頭へ… |