2

レジストリに新しい値を書き込む必要があります。追加できるのは標準キーであり、新しい 10 進数値を DWORD キーに配置する必要があるため (16 進数値の代わりに)、次のコードで行き詰まりました。

{Dim wsh wsh = CreateObject("WScript.shell") wsh.regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer\NoDrives\dword", "789")}

4

1 に答える 1

0

私は次のようなものを使用します:

Imports Microsoft.Win32

Sub SetNoDrives(value As Integer)
    Dim RegPath As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer"
    Using Key As RegistryKey = Registry.LocalMachine.OpenSubKey(RegPath)
        Key.SetValue("NoDrives", value, RegistryValueKind.DWord)
    End Using
End Sub
于 2011-06-30T07:37:53.590 に答える