WMI Fun !! 〜 WMI に興味がある方・システム管理者必見! 〜 |
|
![]() |
WMI Fun !! > WMI Sample (VB) > 一番最後に振られているドライブレター割当文字を取得する |
私も使っていますお勧め SIM フリースマホ ASUS Zenfone
ATM 利用時の入出金手数料が最大 7 回/月無料、 一番最後に振られているドライブレター割当文字を取得する: Win32_BootConfiguration - WMI Sample (VB)Topics
一番最後に振られているドライブレター割当文字を取得するサンプルプログラムです。
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
個人的にお勧めする本の紹介です。 ![]() |
ご意見・ご要望・ご感想をこちらのアンケートからお待ちしています |
∧ ページの先頭へ… |