2009年12月27日日曜日

Check & Setting Tool (CST) 0.3.6.2

練習寫TABPAGE所以就分成2頁了XD


設定後(一般)

設定後(服務,有關Windows Search)

設定前(一般)

設定前(服務)

下載點:
http://amgbelldandy.myweb.hinet.net/cst.zip (0.3.6.2)
SHA1:e219ed74e41eeb318363911617e5deb3486aafc8
請小心食用(?

Public Class Form1
    Dim regget(10) As String
    Dim regpath(5) As String
    Dim servicename(6) As String
    Dim strComputer = "."
    Dim objWMIService = GetObject("winmgmts:\\" & strComputer)
    Dim colSettings = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Text = "Check & Setting Tool"

        TabPage1.Text = "General"
        TabPage2.Text = "Service"

        GroupBox1.Text = "Name"
        GroupBox2.Text = "Name"
        GroupBox3.Text = "Setting"
        GroupBox4.Text = "Setting (Need Reboot)"

        ComboBox4.Items.Add("Disable")
        ComboBox4.Items.Add("Enable")
        ComboBox5.Items.Add("Disable")
        ComboBox5.Items.Add("Enable")
        ComboBox51.Items.Add("Disabled")
        ComboBox51.Items.Add("Auto")
        ComboBox52.Items.Add("Disabled")
        ComboBox52.Items.Add("Auto")
        ComboBox53.Items.Add("Disabled")
        ComboBox53.Items.Add("Auto")
        ComboBox54.Items.Add("Disabled")
        ComboBox54.Items.Add("Auto")
        ComboBox55.Items.Add("Disabled")
        ComboBox55.Items.Add("Auto")
        ComboBox56.Items.Add("Disabled")
        ComboBox56.Items.Add("Auto")

        Button1.Text = "RegisteredOwner"
        Button2.Text = "RegisteredOrganization"
        Button3.Text = "Folder Option Settings"
        Button4.Text = "AutoPlay"
        Button5.Text = "User Account Control"
        Button6.Text = "ComputerName"
        Button7.Text = "ComputerWorkgroup"
        Button11.Text = "Input"
        Button12.Text = "Input"
        Button13.Text = "Setting"
        Button14.Text = ComboBox4.Text
        Button15.Text = ComboBox5.Text
        Button16.Text = ""
        Button17.Text = ""
        Button51.Text = "No Service"
        Button52.Text = "No Service"
        Button53.Text = "No Service"
        Button54.Text = "No Service"
        Button55.Text = "No Service"
        Button56.Text = "No Service"
        Button101.Text = "Refresh"
        Button102.Text = "Setting All"
        Button103.Text = "Default"

        Label1.Text = ""
        Label2.Text = ""
        Label3.Text = "(Read ToolTip First)"
        Label4.Text = ""
        Label5.Text = "(Need Reboot)"
        Label6.Text = ""
        Label7.Text = ""
        Label51.Text = "No Service"
        Label52.Text = "No Service"
        Label53.Text = "No Service"
        Label54.Text = "No Service"
        Label55.Text = "No Service"
        Label56.Text = "No Service"
        Label101.Text = "(Information)"
        Label102.Text = "(ServiceName)"
        Label103.Text = "(Option)"
        Label104.Text = "(ServiceStartMode)"
        Label105.Text = "(ServiceState)"
        Label106.Text = "(Option)"
        Label150.Text = "Version 0.3.6.2"

        RadioButton1.Text = "On"
        RadioButton2.Text = "Off"

        TextBox51.Text = "No Service"
        TextBox52.Text = "No Service"
        TextBox53.Text = "No Service"
        TextBox54.Text = "No Service"
        TextBox55.Text = "No Service"
        TextBox56.Text = "No Service"

        regpath(0) = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
        regpath(1) = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
        regpath(2) = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers"
        regpath(3) = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
        regpath(4) = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services"

        Me.Button101.PerformClick()
        Me.Button103.PerformClick()
    End Sub

    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button101.Click
        regget(0) = My.Computer.Registry.GetValue _
                    (regpath(0), "RegisteredOwner", Nothing)
        regget(1) = My.Computer.Registry.GetValue _
                    (regpath(0), "RegisteredOrganization", Nothing)
        regget(2) = My.Computer.Registry.GetValue _
                    (regpath(1), "Hidden", Nothing)
        regget(3) = My.Computer.Registry.GetValue _
                    (regpath(1), "HideFileExt", Nothing)
        regget(4) = My.Computer.Registry.GetValue _
                    (regpath(1), "ShowSuperHidden", Nothing)
        regget(5) = My.Computer.Registry.GetValue _
                    (regpath(1), "SeparateProcess", Nothing)
        regget(6) = My.Computer.Registry.GetValue _
                    (regpath(1), "ShowCompColor", Nothing)
        regget(7) = My.Computer.Registry.GetValue _
                    (regpath(1), "SharingWizardOn", Nothing)
        regget(8) = My.Computer.Registry.GetValue _
                    (regpath(2), "DisableAutoplay", Nothing)
        regget(9) = My.Computer.Registry.GetValue _
                    (regpath(3), "EnableLUA", Nothing)

        TextBox1.Text = regget(0)
        TextBox2.Text = regget(1)

        If regget(2) = 1 And _
           regget(3) = 0 And _
           regget(4) = 1 And _
           regget(5) = 1 And _
           regget(6) = 0 And _
           regget(7) = 0 Then
            TextBox3.Text = "Default Setting"
        Else
            TextBox3.Text = "User Setting"
        End If

        If regget(8) = 1 Then
            TextBox4.Text = "Disabled"
        Else
            TextBox4.Text = "Enabled"
        End If

        If regget(9) = 0 Then
            TextBox5.Text = "Disabled"
        Else
            TextBox5.Text = "Enabled"
        End If

        For Each objComputer In colSettings
            TextBox6.Text = objComputer.Name
            TextBox7.Text = objComputer.Workgroup
        Next

        servicename(0) = "WinDefend"
        servicename(1) = "MpsSvc"
        servicename(2) = "Themes"
        servicename(3) = "AudioSrv"
        servicename(4) = "wscsvc"
        servicename(5) = "WSearch"
        For i = 0 To 5 Step 1
            If My.Computer.Registry.GetValue _
               (regpath(4) & "\" & servicename(i), _
               "DisplayName", Nothing) Is Nothing Then
                Select Case servicename(i)
                    Case servicename(0)
                        Button61.Visible = False
                        ComboBox51.Visible = False
                    Case servicename(1)
                        Button62.Visible = False
                        ComboBox52.Visible = False
                    Case servicename(2)
                        Button63.Visible = False
                        ComboBox53.Visible = False
                    Case servicename(3)
                        Button64.Visible = False
                        ComboBox54.Visible = False
                    Case servicename(4)
                        Button65.Visible = False
                        ComboBox55.Visible = False
                    Case servicename(5)
                        Button66.Visible = False
                        ComboBox56.Visible = False
                End Select
            Else
                Select Case servicename(i)
                    Case servicename(0)
                        Dim WinDefend = objWMIService.Get _
                        ("Win32_Service.Name='WinDefend'")
                        Button51.Text = WinDefend.DisplayName
                        TextBox51.Text = WinDefend.StartMode
                        Button61.Text = ComboBox51.Text
                        Label51.Text = WinDefend.State()
                    Case servicename(1)
                        Dim MpsSvc = objWMIService.Get _
                        ("Win32_Service.Name='MpsSvc'")
                        Button52.Text = MpsSvc.DisplayName
                        TextBox52.Text = MpsSvc.StartMode
                        Button62.Text = ComboBox52.Text
                        Label52.Text = MpsSvc.State()
                    Case servicename(2)
                        Dim Themes = objWMIService.Get _
                        ("Win32_Service.Name='Themes'")
                        Button53.Text = Themes.DisplayName
                        TextBox53.Text = Themes.StartMode
                        Button63.Text = ComboBox53.Text
                        Label53.Text = Themes.State()
                    Case servicename(3)
                        Dim AudioSrv = objWMIService.Get _
                        ("Win32_Service.Name='AudioSrv'")
                        Button54.Text = AudioSrv.DisplayName
                        TextBox54.Text = AudioSrv.StartMode
                        Button64.Text = ComboBox54.Text
                        Label54.Text = AudioSrv.State()
                    Case servicename(4)
                        Dim wscsvc = objWMIService.Get _
                        ("Win32_Service.Name='wscsvc'")
                        Button55.Text = wscsvc.DisplayName
                        TextBox55.Text = wscsvc.StartMode
                        Button65.Text = ComboBox55.Text
                        Label55.Text = wscsvc.State
                    Case servicename(5)
                        Dim WSearch = objWMIService.Get _
                        ("Win32_Service.Name='WSearch'")
                        Button56.Text = WSearch.DisplayName
                        TextBox56.Text = WSearch.StartMode
                        Button66.Text = ComboBox56.Text
                        Label56.Text = WSearch.State
                End Select
            End If
        Next
    End Sub

    Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
        If ComboBox4.SelectedIndex = 0 Then
            My.Computer.Registry.SetValue _
            (regpath(2), "DisableAutoplay", "1", Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(2), "DisableAutoplay", "0", Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
        If ComboBox5.SelectedIndex = 0 Then
            My.Computer.Registry.SetValue _
            (regpath(3), "EnableLUA", "0", Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(3), "EnableLUA", "1", Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
        My.Computer.Registry.SetValue _
        (regpath(1), "Hidden", "1", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "HideFileExt", "0", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "ShowSuperHidden", "1", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "SeparateProcess", "1", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "ShowCompColor", "0", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "SharingWizardOn", "0", Microsoft.Win32.RegistryValueKind.DWord)
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        Dim RegisteredOwner As String
        RegisteredOwner = TextBox11.Text
        My.Computer.Registry.SetValue _
        (regpath(0), "RegisteredOwner", RegisteredOwner, Microsoft.Win32.RegistryValueKind.String)
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
        Dim RegisteredOrganization As String
        RegisteredOrganization = TextBox12.Text
        My.Computer.Registry.SetValue _
        (regpath(0), "RegisteredOrganization", RegisteredOrganization, Microsoft.Win32.RegistryValueKind.String)
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button61.Click
        If ComboBox51.SelectedIndex = 0 Then
            My.Computer.Registry.SetValue _
            (regpath(4) & "\WinDefend", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(4) & "\WinDefend", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button62.Click
        If ComboBox52.SelectedIndex = 0 Then
            My.Computer.Registry.SetValue _
            (regpath(4) & "\MpsSvc", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(4) & "\MpsSvc", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button63.Click
        If ComboBox53.SelectedIndex = 1 Then
            My.Computer.Registry.SetValue _
            (regpath(4) & "\Themes", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(4) & "\Themes", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button64.Click
        If ComboBox54.SelectedIndex = 1 Then
            My.Computer.Registry.SetValue _
            (regpath(4) & "\AudioSrv", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(4) & "\AudioSrv", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button65.Click
        If ComboBox55.SelectedIndex = 0 Then
            My.Computer.Registry.SetValue _
            (regpath(4) & "\wscsvc", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(4) & "\wscsvc", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button26_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button102.Click
        Me.TabControl1.SelectedTab = TabPage1
        Me.Button11.PerformClick()
        Me.Button12.PerformClick()
        Me.Button13.PerformClick()
        Me.Button14.PerformClick()
        Me.Button15.PerformClick()
        Me.TabControl1.SelectedTab = TabPage2
        Me.Button61.PerformClick()
        Me.Button62.PerformClick()
        Me.Button63.PerformClick()
        Me.Button64.PerformClick()
        Me.Button65.PerformClick()
        Me.Button66.PerformClick()
        Me.TabControl1.SelectedTab = TabPage1
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged
        Button14.Text = ComboBox4.Text
    End Sub

    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox5.SelectedIndexChanged
        Button15.Text = ComboBox5.Text
    End Sub

    Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox51.SelectedIndexChanged
        Button61.Text = ComboBox51.Text
    End Sub

    Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox52.SelectedIndexChanged
        Button62.Text = ComboBox52.Text
    End Sub

    Private Sub ComboBox5_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox53.SelectedIndexChanged
        Button63.Text = ComboBox53.Text
    End Sub

    Private Sub ComboBox6_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox54.SelectedIndexChanged
        Button64.Text = ComboBox54.Text
    End Sub

    Private Sub ComboBox7_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox55.SelectedIndexChanged
        Button65.Text = ComboBox55.Text
    End Sub

    Private Sub Button28_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button103.Click
        TextBox11.Text = "Belldandy"
        TextBox12.Text = "Syaorin"
        ComboBox4.SelectedIndex = 0
        ComboBox5.SelectedIndex = 0
        ComboBox51.SelectedIndex = 0
        ComboBox52.SelectedIndex = 0
        ComboBox53.SelectedIndex = 1
        ComboBox54.SelectedIndex = 1
        ComboBox55.SelectedIndex = 0
        ComboBox56.SelectedIndex = 1
        RadioButton1.Checked = True
    End Sub

    Private Sub Button66_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button66.Click
        If ComboBox56.SelectedIndex = 1 Then
            My.Computer.Registry.SetValue _
            (regpath(4) & "\WSearch", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(4) & "\WSearch", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub ComboBox56_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox56.SelectedIndexChanged
        Button66.Text = ComboBox56.Text
    End Sub

    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        Button13.Enabled = True
    End Sub

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        Button13.Enabled = False
    End Sub
End Class

MSN 不用裝防毒程式傳檔設定方法

依照上圖設定 打2個雙引號即可
補充一下
這個方法缺點是會顯示掃毒失敗

2009年12月16日水曜日

Check & Setting Tool Version 0.3.6

根據建議 重寫了設定介面





下載點:
http://amgbelldandy.myweb.hinet.net/WindowsApplication.zip (0.3.6)
SHA1:c30813afe75f909bd09660da8defdbedd4254d92
請小心食用(?


Public Class Form1
    Dim regget(10) As String
    Dim regpath(5) As String
    Dim servicename(6) As String
    Dim strComputer = "."
    Dim objWMIService = GetObject("winmgmts:\\" & strComputer)
    Dim colSettings = objWMIService.ExecQuery _
    ("Select * from Win32_ComputerSystem")
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Text = "Check & Setting Tool"

        GroupBox1.Text = "General"
        GroupBox2.Text = "Service"
        GroupBox3.Text = "General Setting"
        GroupBox4.Text = "Service Setting (Need Reboot)"

        ComboBox4.Items.Add("Disable")
        ComboBox4.Items.Add("Enable")
        ComboBox4.SelectedIndex = 0
        ComboBox5.Items.Add("Disable")
        ComboBox5.Items.Add("Enable")
        ComboBox5.SelectedIndex = 0
        ComboBox51.Items.Add("Disabled")
        ComboBox51.Items.Add("Auto")
        ComboBox51.SelectedIndex = 0
        ComboBox52.Items.Add("Disabled")
        ComboBox52.Items.Add("Auto")
        ComboBox52.SelectedIndex = 0
        ComboBox53.Items.Add("Disabled")
        ComboBox53.Items.Add("Auto")
        ComboBox53.SelectedIndex = 1
        ComboBox54.Items.Add("Disabled")
        ComboBox54.Items.Add("Auto")
        ComboBox54.SelectedIndex = 1
        ComboBox55.Items.Add("Disabled")
        ComboBox55.Items.Add("Auto")
        ComboBox55.SelectedIndex = 0
        ComboBox56.Items.Add("Disabled")
        ComboBox56.Items.Add("Auto")
        ComboBox56.SelectedIndex = 1

        Button1.Text = "RegisteredOwner"
        Button2.Text = "RegisteredOrganization"
        Button3.Text = "Folder Option Settings"
        Button4.Text = "AutoPlay"
        Button5.Text = "User Account Control"
        Button6.Text = "ComputerName"
        Button7.Text = "ComputerWorkgroup"
        Button11.Text = "Input"
        Button12.Text = "Input"
        Button13.Text = "Setting"
        Button14.Text = ComboBox4.Text
        Button15.Text = ComboBox5.Text
        Button16.Text = ""
        Button17.Text = ""
        Button23.Text = ""
        Button51.Text = "No Service"
        Button52.Text = "No Service"
        Button53.Text = "No Service"
        Button54.Text = "No Service"
        Button55.Text = "No Service"
        Button56.Text = "No Service"
        Button101.Text = "Refresh"
        Button102.Text = "Setting All"
        Button103.Text = "Default"

        Label1.Text = ""
        Label2.Text = ""
        Label3.Text = "(Read ToolTip First)"
        Label4.Text = ""
        Label5.Text = "(Need Reboot)"
        Label6.Text = ""
        Label7.Text = ""
        Label51.Text = "No Service"
        Label52.Text = "No Service"
        Label53.Text = "No Service"
        Label54.Text = "No Service"
        Label55.Text = "No Service"
        Label56.Text = "No Service"
        Label101.Text = "(Information)"
        Label102.Text = "(ServiceName)"
        Label103.Text = "(Option)"
        Label104.Text = "(ServiceStartMode)"
        Label105.Text = "(ServiceState)"
        Label106.Text = "(Option)"
        Label150.Text = "Version 0.3.6"

        TextBox11.Text = "Belldandy"
        TextBox12.Text = "Syaorin"
        TextBox51.Text = "No Service"
        TextBox52.Text = "No Service"
        TextBox53.Text = "No Service"
        TextBox54.Text = "No Service"
        TextBox55.Text = "No Service"
        TextBox56.Text = "No Service"

        regpath(0) = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
        regpath(1) = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
        regpath(2) = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers"
        regpath(3) = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
        regpath(4) = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services"

        Me.Button101.PerformClick()
    End Sub

    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button101.Click
        regget(0) = My.Computer.Registry.GetValue _
                    (regpath(0), "RegisteredOwner", Nothing)
        regget(1) = My.Computer.Registry.GetValue _
                    (regpath(0), "RegisteredOrganization", Nothing)
        regget(2) = My.Computer.Registry.GetValue _
                    (regpath(1), "Hidden", Nothing)
        regget(3) = My.Computer.Registry.GetValue _
                    (regpath(1), "HideFileExt", Nothing)
        regget(4) = My.Computer.Registry.GetValue _
                    (regpath(1), "ShowSuperHidden", Nothing)
        regget(5) = My.Computer.Registry.GetValue _
                    (regpath(1), "SeparateProcess", Nothing)
        regget(6) = My.Computer.Registry.GetValue _
                    (regpath(1), "ShowCompColor", Nothing)
        regget(7) = My.Computer.Registry.GetValue _
                    (regpath(1), "SharingWizardOn", Nothing)
        regget(8) = My.Computer.Registry.GetValue _
                    (regpath(2), "DisableAutoplay", Nothing)
        regget(9) = My.Computer.Registry.GetValue _
                    (regpath(3), "EnableLUA", Nothing)

        TextBox1.Text = regget(0)
        TextBox2.Text = regget(1)
        If regget(2) = 1 And _
           regget(3) = 0 And _
           regget(4) = 1 And _
           regget(5) = 1 And _
           regget(6) = 0 And _
           regget(7) = 0 Then
            TextBox3.Text = "Default Setting"
        Else
            TextBox3.Text = "User Setting"
        End If
        If regget(8) = 1 Then
            TextBox4.Text = "Disabled"
        Else
            TextBox4.Text = "Enabled"
        End If
        If regget(9) = 0 Then
            TextBox5.Text = "Disabled"
        Else
            TextBox5.Text = "Enabled"
        End If
        For Each objComputer In colSettings
            TextBox6.Text = objComputer.Name
            TextBox7.Text = objComputer.Workgroup
        Next

        servicename(0) = "WinDefend"
        servicename(1) = "MpsSvc"
        servicename(2) = "Themes"
        servicename(3) = "AudioSrv"
        servicename(4) = "wscsvc"
        servicename(5) = "WSearch"
        For i = 0 To 5 Step 1
            If My.Computer.Registry.GetValue _
               (regpath(4) & "\" & servicename(i), _
               "DisplayName", Nothing) Is Nothing Then
                Select Case servicename(i)
                    Case servicename(0)
                        Button61.Visible = False
                        ComboBox51.Visible = False
                    Case servicename(1)
                        Button62.Visible = False
                        ComboBox52.Visible = False
                    Case servicename(2)
                        Button63.Visible = False
                        ComboBox53.Visible = False
                    Case servicename(3)
                        Button64.Visible = False
                        ComboBox54.Visible = False
                    Case servicename(4)
                        Button65.Visible = False
                        ComboBox55.Visible = False
                    Case servicename(5)
                        Button66.Visible = False
                        ComboBox56.Visible = False
                End Select
            Else
                Select Case servicename(i)
                    Case servicename(0)
                        Dim WinDefend = objWMIService.Get _
                        ("Win32_Service.Name='WinDefend'")
                        Button51.Text = WinDefend.DisplayName
                        TextBox51.Text = WinDefend.StartMode
                        Button61.Text = ComboBox51.Text
                        Label51.Text = WinDefend.State()
                    Case servicename(1)
                        Dim MpsSvc = objWMIService.Get _
                        ("Win32_Service.Name='MpsSvc'")
                        Button52.Text = MpsSvc.DisplayName
                        TextBox52.Text = MpsSvc.StartMode
                        Button62.Text = ComboBox52.Text
                        Label52.Text = MpsSvc.State()
                    Case servicename(2)
                        Dim Themes = objWMIService.Get _
                        ("Win32_Service.Name='Themes'")
                        Button53.Text = Themes.DisplayName
                        TextBox53.Text = Themes.StartMode
                        Button63.Text = ComboBox53.Text
                        Label53.Text = Themes.State()
                    Case servicename(3)
                        Dim AudioSrv = objWMIService.Get _
                        ("Win32_Service.Name='AudioSrv'")
                        Button54.Text = AudioSrv.DisplayName
                        TextBox54.Text = AudioSrv.StartMode
                        Button64.Text = ComboBox54.Text
                        Label54.Text = AudioSrv.State()
                    Case servicename(4)
                        Dim wscsvc = objWMIService.Get _
                        ("Win32_Service.Name='wscsvc'")
                        Button55.Text = wscsvc.DisplayName
                        TextBox55.Text = wscsvc.StartMode
                        Button65.Text = ComboBox55.Text
                        Label55.Text = wscsvc.State
                    Case servicename(5)
                        Dim WSearch = objWMIService.Get _
                        ("Win32_Service.Name='WSearch'")
                        Button56.Text = WSearch.DisplayName
                        TextBox56.Text = WSearch.StartMode
                        Button66.Text = ComboBox56.Text
                        Label56.Text = WSearch.State
                End Select
            End If
        Next
    End Sub

    Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
        If ComboBox4.SelectedIndex = 0 Then
            My.Computer.Registry.SetValue _
            (regpath(2), "DisableAutoplay", "1", Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(2), "DisableAutoplay", "0", Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
        If ComboBox5.SelectedIndex = 0 Then
            My.Computer.Registry.SetValue _
            (regpath(3), "EnableLUA", "0", Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(3), "EnableLUA", "1", Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
        My.Computer.Registry.SetValue _
        (regpath(1), "Hidden", "1", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "HideFileExt", "0", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "ShowSuperHidden", "1", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "SeparateProcess", "1", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "ShowCompColor", "0", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "SharingWizardOn", "0", Microsoft.Win32.RegistryValueKind.DWord)
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        Dim RegisteredOwner As String
        RegisteredOwner = TextBox11.Text
        My.Computer.Registry.SetValue _
        (regpath(0), "RegisteredOwner", RegisteredOwner, Microsoft.Win32.RegistryValueKind.String)
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
        Dim RegisteredOrganization As String
        RegisteredOrganization = TextBox12.Text
        My.Computer.Registry.SetValue _
        (regpath(0), "RegisteredOrganization", RegisteredOrganization, Microsoft.Win32.RegistryValueKind.String)
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button61.Click
        If ComboBox51.SelectedIndex = 0 Then
            My.Computer.Registry.SetValue _
            (regpath(4) & "\WinDefend", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(4) & "\WinDefend", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button62.Click
        If ComboBox52.SelectedIndex = 0 Then
            My.Computer.Registry.SetValue _
            (regpath(4) & "\MpsSvc", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(4) & "\MpsSvc", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button63.Click
        If ComboBox53.SelectedIndex = 1 Then
            My.Computer.Registry.SetValue _
            (regpath(4) & "\Themes", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(4) & "\Themes", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button64.Click
        If ComboBox54.SelectedIndex = 1 Then
            My.Computer.Registry.SetValue _
            (regpath(4) & "\AudioSrv", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(4) & "\AudioSrv", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button65.Click
        If ComboBox55.SelectedIndex = 0 Then
            My.Computer.Registry.SetValue _
            (regpath(4) & "\wscsvc", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(4) & "\wscsvc", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub Button26_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button102.Click
        Me.Button11.PerformClick()
        Me.Button12.PerformClick()
        Me.Button13.PerformClick()
        Me.Button14.PerformClick()
        Me.Button15.PerformClick()
        Me.Button61.PerformClick()
        Me.Button62.PerformClick()
        Me.Button63.PerformClick()
        Me.Button64.PerformClick()
        Me.Button65.PerformClick()
        Me.Button66.PerformClick()
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged
        Button14.Text = ComboBox4.Text
    End Sub

    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox5.SelectedIndexChanged
        Button15.Text = ComboBox5.Text
    End Sub

    Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox51.SelectedIndexChanged
        Button61.Text = ComboBox51.Text
    End Sub

    Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox52.SelectedIndexChanged
        Button62.Text = ComboBox52.Text
    End Sub

    Private Sub ComboBox5_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox53.SelectedIndexChanged
        Button63.Text = ComboBox53.Text
    End Sub

    Private Sub ComboBox6_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox54.SelectedIndexChanged
        Button64.Text = ComboBox54.Text
    End Sub

    Private Sub ComboBox7_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox55.SelectedIndexChanged
        Button65.Text = ComboBox55.Text
    End Sub

    Private Sub Button28_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button103.Click
        TextBox11.Text = "Belldandy"
        TextBox12.Text = "Syaorin"
        ComboBox4.SelectedIndex = 0
        ComboBox5.SelectedIndex = 0
        ComboBox51.SelectedIndex = 0
        ComboBox52.SelectedIndex = 0
        ComboBox53.SelectedIndex = 1
        ComboBox54.SelectedIndex = 1
        ComboBox55.SelectedIndex = 0
        ComboBox56.SelectedIndex = 1
    End Sub

    Private Sub Button66_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button66.Click
        If ComboBox56.SelectedIndex = 1 Then
            My.Computer.Registry.SetValue _
            (regpath(4) & "\WSearch", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        Else
            My.Computer.Registry.SetValue _
            (regpath(4) & "\WSearch", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        End If
        Me.Button101.PerformClick()
    End Sub

    Private Sub ComboBox56_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox56.SelectedIndexChanged
        Button66.Text = ComboBox56.Text
    End Sub
End Class

2009年12月12日土曜日

Check & Setting Tool 使用說明

執行畫面:(Windows 7和Windows Server 2008 R2)


Windows Server 2008 R2 服務的部份會有3個顯示No Service
因為 WS2008R2 沒有 Security Center 故不能設定此選項
而 Themes 和 Windows Defender 需安裝 Desktop Experience 才能設定

程式功能:
1.設定登錄的使用者和公司
2.設定資料夾選項 更改設定為下面六項(因主要使用為日英版 故使用英文)
Hidden files and folders -> Show hidden files, folders, and drives
Hide extensions for known file types -> Not selected
Hide protected operating system files (Recommended) -> Not selected
Launch folder windows in a separate process -> Selected
Show encrypted or compressed NTFS files in color -> Not selected
Use Sharing Wizard (Recommended) -> Not selected
如果這六項設定任一項設定不同上面 檢查後會顯示 Error
3.關閉自動播放
4.關閉UAC
5.顯示目前電腦名稱和工作群組
6.關閉服務(Windows Defender,Windows Firewall,Security Center) PS:WS2008R2無Security Center
7.啟動服務(Themes,Windows Audio) PS:給 WS2008R2 用的 Windows 7 預設已啟動
8.Auto功能 懶人用 按一下就設定上面所有的內容

程式環境:
要有.NET 2.0
基本上只建議 Windows 7 和 WS2008R2 使用
Vista 和 WS2008 應該也可以用(未測試過 目前沒跑這2種的虛擬機器)
XP 和 WS2003 不建議使用(出錯機率蠻高的XD)

其它建議:
因為關了 Windows Defender , Windows Firewall , Security Center 這3個服務
建議自己另外裝防火牆和防毒軟體

常見問題:
如果出現此錯誤的話:

請用Administrator執行(如下圖)

如果出現UAC的警告畫面 請按YES

設定完不滿意的話
就去控制台一個一個改回來
目前不提供懶人回復法XD

下載點:
SHA1:c30813afe75f909bd09660da8defdbedd4254d92
請小心食用(?

2009年12月10日木曜日

Check & Setting Tool 0.3.4

主要是拿來設定 Windows 7 和 Windows Server 2008 R2(Desktop Experience要先裝)
簡化設定的過程
寫得有點爛
能用就好(死

2009/12/11 重寫了一些部份(Button13)

Windows 7 和 Windows Server 2008R2 的圖片:




Public Class Form1
    Dim regget(10) As String
    Dim regpath(5) As String
    Dim servicename(5) As String
    Dim strComputer = "."
    Dim objWMIService = GetObject("winmgmts:\\" & strComputer)
    Dim colSettings = objWMIService.ExecQuery _
    ("Select * from Win32_ComputerSystem")
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Text = "Check & Setting Tool 0.3.4"
        GroupBox1.Text = "General"
        GroupBox2.Text = "Service"
        GroupBox3.Text = "General Setting"
        GroupBox4.Text = "Service Setting (Need Reboot)"
        Button1.Text = "RegisteredOwner"
        Button2.Text = "RegisteredOrganization"
        Button3.Text = "Folder Option Settings"
        Button4.Text = "AutoPlay"
        Button5.Text = "User Account Control"
        Button6.Text = "ComputerName"
        Button7.Text = "ComputerWorkgroup"
        Button8.Text = "No Service"
        Button9.Text = "No Service"
        Button10.Text = "No Service"
        Button11.Text = "No Service"
        Button12.Text = "No Service"
        Button13.Text = "Refresh"
        Button14.Text = "Input"
        Button15.Text = "Input"
        Button16.Text = "Setting"
        Button17.Text = "Disable"
        Button18.Text = "Disable"
        Button19.Text = ""
        Button20.Text = ""
        Button21.Text = "No Service"
        Button22.Text = "No Service"
        Button23.Text = "No Service"
        Button24.Text = "No Service"
        Button25.Text = "No Service"
        Button26.Text = "Auto Setting"
        Label1.Text = ""
        Label2.Text = ""
        Label3.Text = "(Read ToolTip First)"
        Label4.Text = ""
        Label5.Text = "(Need Reboot)"
        Label6.Text = ""
        Label7.Text = ""
        Label8.Text = "(Start Mode)"
        Label9.Text = "(Click)"
        Label10.Text = "(Click)"
        Label11.Text = "No Service"
        Label12.Text = "No Service"
        Label13.Text = "No Service"
        Label14.Text = "No Service"
        Label15.Text = "No Service"
        Label16.Text = "(Read From WMI)"
        Label17.Text = "(Service State)"
        Label18.Text = "(Information)"
        TextBox8.Text = "No Service"
        TextBox9.Text = "No Service"
        TextBox10.Text = "No Service"
        TextBox11.Text = "No Service"
        TextBox12.Text = "No Service"
        TextBox13.Text = "Belldandy"
        TextBox14.Text = "Syaorin"
        regpath(0) = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
        regpath(1) = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
        regpath(2) = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers"
        regpath(3) = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
        regpath(4) = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services"
        Me.Button13.PerformClick()
    End Sub

    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
        regget(0) = My.Computer.Registry.GetValue _
                    (regpath(0), "RegisteredOwner", Nothing)
        regget(1) = My.Computer.Registry.GetValue _
                    (regpath(0), "RegisteredOrganization", Nothing)
        regget(2) = My.Computer.Registry.GetValue _
                    (regpath(1), "Hidden", Nothing)
        regget(3) = My.Computer.Registry.GetValue _
                    (regpath(1), "HideFileExt", Nothing)
        regget(4) = My.Computer.Registry.GetValue _
                    (regpath(1), "ShowSuperHidden", Nothing)
        regget(5) = My.Computer.Registry.GetValue _
                    (regpath(1), "SeparateProcess", Nothing)
        regget(6) = My.Computer.Registry.GetValue _
                    (regpath(1), "ShowCompColor", Nothing)
        regget(7) = My.Computer.Registry.GetValue _
                    (regpath(1), "SharingWizardOn", Nothing)
        regget(8) = My.Computer.Registry.GetValue _
                    (regpath(2), "DisableAutoplay", Nothing)
        regget(9) = My.Computer.Registry.GetValue _
                    (regpath(3), "EnableLUA", Nothing)
        servicename(0) = "WinDefend"
        servicename(1) = "MpsSvc"
        servicename(2) = "Themes"
        servicename(3) = "AudioSrv"
        servicename(4) = "wscsvc"
        TextBox1.Text = regget(0)
        TextBox2.Text = regget(1)
        If regget(2) = 1 And _
           regget(3) = 0 And _
           regget(4) = 1 And _
           regget(5) = 1 And _
           regget(6) = 0 And _
           regget(7) = 0 Then
            TextBox3.Text = "OK"
        Else
            TextBox3.Text = "Error"
        End If
        If regget(8) = 1 Then
            TextBox4.Text = "Disabled"
        Else
            TextBox4.Text = "Enabled"
        End If
        If regget(9) = 0 Then
            TextBox5.Text = "Disabled"
        Else
            TextBox5.Text = "Enabled"
        End If
        For Each objComputer In colSettings
            TextBox6.Text = objComputer.Name
            TextBox7.Text = objComputer.Workgroup
        Next
        For i = 0 To 4 Step 1
            If My.Computer.Registry.GetValue _
               (regpath(4) & "\" & servicename(i), _
               "DisplayName", Nothing) Is Nothing Then
                Select Case servicename(i)
                    Case servicename(0)
                        Button21.Enabled = False
                    Case servicename(1)
                        Button22.Enabled = False
                    Case servicename(2)
                        Button23.Enabled = False
                    Case servicename(3)
                        Button24.Enabled = False
                    Case servicename(4)
                        Button25.Enabled = False
                End Select
            Else
                Select Case servicename(i)
                    Case servicename(0)
                        Dim WinDefend = objWMIService.Get _
                        ("Win32_Service.Name='WinDefend'")
                        Button8.Text = WinDefend.DisplayName
                        TextBox8.Text = WinDefend.StartMode
                        Button21.Text = "Disable"
                        Label11.Text = WinDefend.State()
                    Case servicename(1)
                        Dim MpsSvc = objWMIService.Get _
                        ("Win32_Service.Name='MpsSvc'")
                        Button9.Text = MpsSvc.DisplayName
                        TextBox9.Text = MpsSvc.StartMode
                        Button22.Text = "Disable"
                        Label12.Text = MpsSvc.State()
                    Case servicename(2)
                        Dim Themes = objWMIService.Get _
                        ("Win32_Service.Name='Themes'")
                        Button10.Text = Themes.DisplayName
                        TextBox10.Text = Themes.StartMode
                        Button23.Text = "Auto"
                        Label13.Text = Themes.State()
                    Case servicename(3)
                        Dim AudioSrv = objWMIService.Get _
                        ("Win32_Service.Name='AudioSrv'")
                        Button11.Text = AudioSrv.DisplayName
                        TextBox11.Text = AudioSrv.StartMode
                        Button24.Text = "Auto"
                        Label14.Text = AudioSrv.State()
                    Case servicename(4)
                        Dim wscsvc = objWMIService.Get _
                        ("Win32_Service.Name='wscsvc'")
                        Button12.Text = wscsvc.DisplayName
                        TextBox12.Text = wscsvc.StartMode
                        Button25.Text = "Disable"
                        Label15.Text = wscsvc.State
                End Select
            End If
        Next
    End Sub

    Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button17.Click
        My.Computer.Registry.SetValue _
        (regpath(2), "DisableAutoplay", "1", Microsoft.Win32.RegistryValueKind.DWord)
        Me.Button13.PerformClick()
    End Sub

    Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
        My.Computer.Registry.SetValue _
        (regpath(3), "EnableLUA", "0", Microsoft.Win32.RegistryValueKind.DWord)
        Me.Button13.PerformClick()
    End Sub

    Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
        My.Computer.Registry.SetValue _
        (regpath(1), "Hidden", "1", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "HideFileExt", "0", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "ShowSuperHidden", "1", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "SeparateProcess", "1", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "ShowCompColor", "0", Microsoft.Win32.RegistryValueKind.DWord)
        My.Computer.Registry.SetValue _
        (regpath(1), "SharingWizardOn", "0", Microsoft.Win32.RegistryValueKind.DWord)
        Me.Button13.PerformClick()
    End Sub

    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
        Dim RegisteredOwner As String
        RegisteredOwner = TextBox13.Text
        My.Computer.Registry.SetValue _
        (regpath(0), "RegisteredOwner", RegisteredOwner, Microsoft.Win32.RegistryValueKind.String)
        Me.Button13.PerformClick()
    End Sub

    Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
        Dim RegisteredOrganization As String
        RegisteredOrganization = TextBox14.Text
        My.Computer.Registry.SetValue _
        (regpath(0), "RegisteredOrganization", RegisteredOrganization, Microsoft.Win32.RegistryValueKind.String)
        Me.Button13.PerformClick()
    End Sub

    Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
        My.Computer.Registry.SetValue _
        (regpath(4) & "\WinDefend", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        Me.Button13.PerformClick()
    End Sub

    Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button22.Click
        My.Computer.Registry.SetValue _
        (regpath(4) & "\MpsSvc", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        Me.Button13.PerformClick()
    End Sub

    Private Sub Button23_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button23.Click
        My.Computer.Registry.SetValue _
        (regpath(4) & "\Themes", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        Me.Button13.PerformClick()
    End Sub

    Private Sub Button24_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button24.Click
        My.Computer.Registry.SetValue _
        (regpath(4) & "\AudioSrv", "Start", 2, Microsoft.Win32.RegistryValueKind.DWord)
        Me.Button13.PerformClick()
    End Sub

    Private Sub Button25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button25.Click
        My.Computer.Registry.SetValue _
        (regpath(4) & "\wscsvc", "Start", 4, Microsoft.Win32.RegistryValueKind.DWord)
        Me.Button13.PerformClick()
    End Sub

    Private Sub Button26_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button26.Click
        Me.Button14.PerformClick()
        Me.Button15.PerformClick()
        Me.Button16.PerformClick()
        Me.Button17.PerformClick()
        Me.Button18.PerformClick()
        Me.Button21.PerformClick()
        Me.Button22.PerformClick()
        Me.Button23.PerformClick()
        Me.Button24.PerformClick()
        Me.Button25.PerformClick()
    End Sub
End Class

OLD PICTURE:
0.3.2

0.3.1

2009年12月6日日曜日

VB.NET Check Tool



Public Class Form1
Dim regget(10) As String
Dim strComputer = "."
Dim objWMIService = GetObject("winmgmts:\\" & strComputer)
Dim colSettings = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
Dim WinDefend = objWMIService.Get("Win32_Service.Name='WinDefend'")
Dim MpsSvc = objWMIService.Get("Win32_Service.Name='MpsSvc'")
Dim Themes = objWMIService.Get("Win32_Service.Name='Themes'")
Dim AudioSrv = objWMIService.Get("Win32_Service.Name='AudioSrv'")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Text = "Check Tool"
Button1.Text = "RegisteredOwner"
Button2.Text = "RegisteredOrganization"
Button3.Text = "Folder Option Settings"
Button4.Text = "AutoPlay"
Button5.Text = "User Account Control"
Button6.Text = "ComputerName"
Button7.Text = "ComputerWorkgroup"
Button8.Text = WinDefend.DisplayName
Button9.Text = MpsSvc.DisplayName
Button10.Text = Themes.DisplayName
Button11.Text = AudioSrv.DisplayName
Button12.Text = "No Service"
regget(0) = My.Computer.Registry.GetValue _
("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "RegisteredOwner", Nothing)
regget(1) = My.Computer.Registry.GetValue _
("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "RegisteredOrganization", Nothing)
regget(2) = My.Computer.Registry.GetValue _
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", Nothing)
regget(3) = My.Computer.Registry.GetValue _
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", Nothing)
regget(4) = My.Computer.Registry.GetValue _
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ShowSuperHidden", Nothing)
regget(5) = My.Computer.Registry.GetValue _
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "SeparateProcess", Nothing)
regget(6) = My.Computer.Registry.GetValue _
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ShowCompColor", Nothing)
regget(7) = My.Computer.Registry.GetValue _
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "SharingWizardOn", Nothing)
regget(8) = My.Computer.Registry.GetValue _
("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers", "DisableAutoplay", Nothing)
regget(9) = My.Computer.Registry.GetValue _
("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA", Nothing)
TextBox1.Text = regget(0)
TextBox2.Text = regget(1)
If regget(2) = 1 And regget(3) = 0 And regget(4) = 1 And regget(5) = 1 And regget(6) = 0 And regget(7) = 0 Then
TextBox3.Text = "OK"
Else
TextBox3.Text = "Error"
End If
If regget(8) = 1 Then
TextBox4.Text = "Disabled"
Else
TextBox4.Text = "Enabled"
End If
If regget(9) = 0 Then
TextBox5.Text = "Disabled"
Else
TextBox5.Text = "Enabled"
End If
For Each objComputer In colSettings
TextBox6.Text = objComputer.Name
TextBox7.Text = objComputer.Workgroup
Next
TextBox8.Text = WinDefend.StartMode & Chr(9) & WinDefend.State
TextBox9.Text = MpsSvc.StartMode & Chr(9) & MpsSvc.State
TextBox10.Text = Themes.StartMode & Chr(9) & Themes.State
TextBox11.Text = AudioSrv.StartMode & Chr(9) & AudioSrv.State
If My.Computer.Registry.GetValue _
("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\wscsvc", "DisplayName", Nothing) Is Nothing Then
TextBox12.Text = "No Service"
Else
Dim wscsvc = objWMIService.Get("Win32_Service.Name='wscsvc'")
Button12.Text = wscsvc.DisplayName
TextBox12.Text = wscsvc.StartMode & Chr(9) & wscsvc.State
End If
End Sub
End Class

2009年12月1日火曜日

TypedPaths 登錄檔

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\TypedPaths]
"url1"="\\\\vmware-host\\Shared Folders"