'================================================================== ' Windows 10 Creators Update (ReleaseID 1703) の settingcontent-ms ファイルのショートカットを作成しますYO! 'http://d.hatena.ne.jp/palm84/20150813/1439476358 'http://d.hatena.ne.jp/palm84/20150822/1440252201 'http://www10.plala.or.jp/palm84/wsh.html 'http://www10.plala.or.jp/palm84/archives/wsh/Win10-1703_CreateSettingContentShortCut.vbs.txt 'https://eu7w9wsmf6a74xyjdfzl3q-on.drv.tw/archives/wsh/Win10-1703_CreateSettingContentShortCut.vbs.txt '================================================================== '2017.4.15 Creators Update ReleaseID 1703 対応 'Shell オブジェクトを作成 Set objShell = WScript.CreateObject("WScript.Shell") 'FileSystemObject オブジェクトを作成 Set objFSO = WScript.CreateObject("Scripting.FileSystemObject") 'Shell .Application オブジェクトを作成 Set objShellApp = CreateObject("Shell.Application") Const Reg_ProductName = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName" Const Reg_ReleaseId = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ReleaseId" myOS = objShell.RegRead(Reg_ProductName) If Not InStr(myOS, "Windows 10") > 0 Then MsgBox "Windows 10 専用クマー (´;ω;`) ",48 ,"I am Sorry, ヒゲソ..(ry" WScript.Quit End If myReleaseID = objShell.RegRead(Reg_ReleaseId) If not myReleaseID = "1703" Then MsgBox "Windows 10 Creators Update (ReleaseID 1703) 専用ですクマー (´;ω;`) ",48 ,"I am Sorry, ヒゲソ..(ry" WScript.Quit End If MyKakunin '*** path *** appPath = objFSO.GetParentFolderName(WScript.ScriptFullName) Content1 = objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%\Packages\windows.immersivecontrolpanel_cw5n1h2txyewy\LocalState\Indexed\Settings\ja-JP\") Content2 = objShell.ExpandEnvironmentStrings("%Windir%\ImmersiveControlPanel\Settings\") If objFSO.FolderExists(Content1) Then Content = Content1 ElseIf objFSO.FolderExists(Content2) Then Content = Content2 End IF myRoot = appPath & "\settingcontent-ms-ショートカット" If Not objFSO.FolderExists(myRoot) Then objFSO.CreateFolder(myRoot) End IF myFolder = myRoot '* ショートカット設定 strFile = "%windir%\explorer.exe" ' Windows 10 strIcon = "%SystemRoot%\System32\shell32.dll, 316" strIconClassic = "%SystemRoot%\System32\shell32.dll, 21" Set objFolder = objShellApp.Namespace(Content) Set objFolderItems = objFolder.Items() Dim Title, strURI MyTest '* 夏時間のオン/オフ 'Title = "夏時間のオン オフ" 'strURI = "AAA_SystemSettings_DateTime_IsAutomaticDSTAdjustEnabled" 'MySC '* Windows 10 コントロール パネルと名前重複 追加 Title = "マイクのセットアップ (設定)" strURI = "AAA_SettingsGroupSpeechMicrophone" MySC '* Windows 10 「タッチパッドを使う時に"タップしてクリック"を無効にします」 'If InStr(myOS, "Windows 10") > 0 Then ' Title = "タッチパッドを使う時に[タップしてクリック]を無効にします" ' strURI = "AAA_SystemSettings_Input_Touch_TapsEnabled" ' MySC 'End If '* 「システムアイコンのオン/オフの切り替え」 ' Windows 10 1703 エラー&重複だが、一方は起動しないので入れ替える Title = "システム アイコンのオンとオフを切り替える" strURI = "AAA_SystemSettings_Taskbar_SystemIcons" MySC '* コメントなし分から追加作成 'AAA_SettingsPageWindowsDefender 必要 Windows Defender 'Classic_{1DD03EE3-FC46-456A-8632-B0717A9D497D} 必要 スクリーン セーバー 'Classic_{D825FEC7-DA3D-456A-BEF2-20F07BA0449E} 必要 デスクトップ アイコンの設定 Title = "Windows Defender" strURI = "AAA_SettingsPageWindowsDefender" If objFSO.FileExists(Content & strURI & ".settingcontent-ms") Then MySC End If Title = "スクリーン セーバー" strURI = "Classic_{1DD03EE3-FC46-456A-8632-B0717A9D497D}" If objFSO.FileExists(Content & strURI & ".settingcontent-ms") Then MySC End If Title = "デスクトップ アイコンの設定" strURI = "Classic_{D825FEC7-DA3D-456A-BEF2-20F07BA0449E}" If objFSO.FileExists(Content & strURI & ".settingcontent-ms") Then MySC End If Kakunin = MsgBox ("終了です YO!", 64 ,"クマー! (´・ω・`) ") Set objItem = Nothing Set objFolderItems = Nothing Set objFolder = Nothing Set objShellApp = Nothing Set objFSO = Nothing Set objShell = Nothing '********************************************************* ' Sub MyKakunin '********************************************************* Sub MyKakunin Kakunin = MsgBox ("settingcontent-ms ファイルのショートカットを作りますのん? (´・ω・`)", 65 ,"settingcontent-ms ファイルのショートカットを作るYO! (´・ω・`) ") If Kakunin = 2 Then WScript.Quit End If End Sub '********************************************************* ' Sub MyTest '********************************************************* Sub MyTest For i=0 To objFolderItems.Count-1 Set objItem = objFolderItems.Item(i) On Error Resume Next For n=0 to 50 strName = objFolder.GetDetailsOf(Nothing, n) If strName = "コメント" Then If objFolder.GetDetailsOf(objItem, n) <> "" Then Title = objFolder.GetDetailsOf(objItem, n) 'WScript.Echo Title strURI = objItem 'WScript.Echo strURI MySc End If End If Next On Error GoTo 0 Next End Sub '********************************************************* 'Sub MySC '********************************************************* Sub MySC strShortCut = myFolder & "\" & Title & ".lnk" '*** ショートカットオブジェクトを作成 *** Set objShortCut = objShell.CreateShortcut(strShortCut) With objShortCut ' リンク先 .TargetPath = strFile ' 作業フォルダ .WorkingDirectory = "" ' 引数 .Arguments = Content & strURI & ".settingcontent-ms" ' コメント .Description = "" ' アイコン If InStr(strURI, "Classic") > 0 Or InStr(strURI, "ControlPanel") > 0 Then .IconLocation = strIconClassic Else .IconLocation = strIcon End If End With objShortCut.Save ''WScript.Echo strFileName & "にショートカットを作成しました。" 'MsgBox "ショートカットを作成しました YO!" & vbcrlf & vbcrlf & Title,64 ,"(´・ω・`) クマー! " End Sub