'================================================================== ' Windows 10 の「設定」ショートカットを作成しますYO! 'http://www10.plala.or.jp/palm84/wsh.html 'http://d.hatena.ne.jp/palm84/20150809/1439131299 'http://www10.plala.or.jp/palm84/archives/wsh/Win10-1703_CreateMsSettingsShortCut.vbs.txt 'https://eu7w9wsmf6a74xyjdfzl3q-on.drv.tw/archives/wsh/Win10-1703_CreateMsSettingsShortCut.vbs.txt '================================================================== '2017.4.10 Creators Update ReleaseID 1703 対応 'Shell オブジェクトを作成 Set objShell = WScript.CreateObject("WScript.Shell") 'FileSystemObject オブジェクトを作成 Set objFSO = WScript.CreateObject("Scripting.FileSystemObject") Const Reg_ProductName = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName" Const Reg_ReleaseId = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ReleaseId" Const Scheme = "ms-settings:" Const ForReading = 1, ForWriting = 2, ForAppending = 8 Const INIFile = "desktop.ini" 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 If Not objShell.RegRead(Reg_ReleaseId) = "1703" Then MsgBox "Creators Update (ReleaseID 1703) 専用クマー (´;ω;`) ",48 ,"I am Sorry, ヒゲソ..(ry" WScript.Quit End If strArguments = "" strWorkingDirectory = "" '*** path *** appPath = objFSO.GetParentFolderName(WScript.ScriptFullName) myRoot = appPath & "\設定ショートカット" 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 MyKakunin If Not objFSO.FolderExists(myRoot) Then objFSO.CreateFolder(myRoot) End IF ReDim arrCategory(10) arrCategory(0) = "01_システム" arrCategory(1) = "02_デバイス" arrCategory(2) = "03_ネットワークとインターネット" 'arrCategory(3) = "パーソナル設定" arrCategory(3) = "04_個人用設定" arrCategory(4) = "05_アプリ" arrCategory(5) = "06_アカウント" arrCategory(6) = "07_時刻と言語" arrCategory(7) = "08_ゲーム" arrCategory(8) = "09_簡単操作" arrCategory(9) = "10_プライバシー" arrCategory(10) = "11_更新とセキュリティ" For x = 0 To 10 dirCategory = myRoot & "\" & arrCategory(x) If Not objFSO.FolderExists(dirCategory) Then objFSO.CreateFolder(dirCategory) End If Next '*** 設定 *** myFolder = myRoot Title = "設定" strFile = Scheme strWorkingDirectory = "" strIcon = "%SystemRoot%\System32\shell32.dll, 316" MySC '*** xxxxx *** Dim strTitle(99), strURI(99) ' strTitle(xx) = "" ' strURI(xx) = "" '*** システム *** myFolder = myRoot & "\01_システム" strTitle(0) = "ディスプレイ" strURI(0) = "display" strTitle(1) = "通知とアクション" strURI(1) = "notifications" strTitle(2) = "電源とスリープ" strURI(2) = "powersleep" strTitle(3) = "バッテリー" strURI(3) = "batterysaver" strTitle(4) = "ストレージ" strURI(4) = "storagesense" strTitle(5) = "タブレット モード" strURI(5) = "tabletmode" strTitle(6) = "マルチタスク" strURI(6) = "multitasking" strTitle(7) = "この PC へのプロジェクション" strURI(7) = "project" strTitle(8) = "共有エクスペリエンス" strURI(8) = "crossdevice" strTitle(9) = "バージョン情報" strURI(9) = "about" For y = 0 to 9 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** デバイス *** myFolder = myRoot & "\02_デバイス" strTitle(10) = "Bluetooth とその他のデバイス" strURI(10) = "bluetooth" strTitle(11) = "プリンタとスキャナー" strURI(11) = "printers" strTitle(12) = "マウス" strURI(12) = "mousetouchpad" strTitle(13) = "タッチパッド" strURI(13) = "devices-touchpad" strTitle(14) = "ペンと Windows Ink" strURI(14) = "pen" strTitle(15) = "自動再生" strURI(15) = "autoplay" strTitle(16) = "USB" strURI(16) = ":usb" For y = 10 to 16 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** ネットワークとインターネット *** myFolder = myRoot & "\03_ネットワークとインターネット" strTitle(17) = "状態" strURI(17) = "network-status" strTitle(18) = "Wi-Fi" strURI(18) = "network-wifi" strTitle(19) = "イーサネット" strURI(19) = "network-ethernet" strTitle(20) = "ダイヤルアップ" strURI(20) = "network-dialup" strTitle(21) = "VPN" strURI(21) = "network-vpn" strTitle(22) = "機内モード" strURI(22) = "network-airplanemode" strTitle(23) = "モバイル ホットスポット" strURI(23) = "network-mobilehotspot" strTitle(24) = "データ使用状況" strURI(24) = "datausage" strTitle(25) = "プロキシ" strURI(25) = "network-proxy" For y = 17 to 25 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** 個人用設定 *** myFolder = myRoot & "\04_個人用設定" strTitle(26) = "背景" strURI(26) = "personalization-background" strTitle(27) = "色" strURI(27) = "colors" strTitle(28) = "ロック画面" strURI(28) = "lockscreen" strTitle(29) = "テーマ" strURI(29) = "themes" strTitle(30) = "スタート" strURI(30) = "personalization-start" strTitle(31) = "タスクバー" strURI(31) = "taskbar" For y = 26 to 31 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** アプリ *** myFolder = myRoot & "\05_アプリ" strTitle(32) = "アプリと機能" strURI(32) = "appsfeatures" strTitle(33) = "既定のアプリ" strURI(33) = "defaultapps" strTitle(34) = "オフライン マップ" strURI(34) = "maps" strTitle(35) = "Web サイト用のアプリ" strURI(35) = "appsforwebsites" For y = 32 to 35 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** アカウント *** myFolder = myRoot & "\06_アカウント" strTitle(36) = "ユーザーの情報" strURI(36) = "yourinfo" strTitle(37) = "メール & アプリのアカウント" strURI(37) = "emailandaccounts" strTitle(38) = "サインイン オプション" strURI(38) = "signinoptions" strTitle(39) = "職場または学校にアクセスする" strURI(39) = "workplace" strTitle(40) = "家族とその他のユーザー" strURI(40) = "otherusers" strTitle(41) = "設定の同期" strURI(41) = "sync" For y = 36 to 41 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** 時刻と言語 *** myFolder = myRoot & "\07_時刻と言語" strTitle(42) = "日付と時刻" strURI(42) = "dateandtime" strTitle(43) = "地域と言語" strURI(43) = "regionlanguage" strTitle(44) = "音声認識" strURI(44) = "speech" For y = 42 to 44 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** ゲーム *** myFolder = myRoot & "\08_ゲーム" strTitle(45) = "ゲーム バー" strURI(45) = "gaming-gamebar" strTitle(46) = "ゲーム DVR" strURI(46) = "gaming-gamedvr" strTitle(47) = "ブロードキャスト" strURI(47) = "gaming-broadcasting" strTitle(48) = "ゲーム" strURI(48) = "gaming-gamemode" For y = 45 to 48 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** 簡単操作 *** myFolder = myRoot & "\09_簡単操作" strTitle(49) = "ナレーター" strURI(49) = "easeofaccess-narrator" strTitle(50) = "拡大鏡" strURI(50) = "easeofaccess-magnifier" strTitle(51) = "ハイ コントラスト" strURI(51) = "easeofaccess-highcontrast" strTitle(52) = "字幕" strURI(52) = "easeofaccess-closedcaptioning" strTitle(53) = "キーボード" strURI(53) = "easeofaccess-keyboard" strTitle(54) = "マウス" strURI(54) = "easeofaccess-mouse" strTitle(55) = "その他のオプション" strURI(55) = "easeofaccess-otheroptions" For y = 49 to 55 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** プライバシー *** myFolder = myRoot & "\10_プライバシー" strTitle(56) = "全般" strURI(56) = "privacy" strTitle(57) = "位置情報" strURI(57) = "privacy-location" strTitle(58) = "カメラ" strURI(58) = "privacy-webcam" strTitle(59) = "マイク" strURI(59) = "privacy-microphone" strTitle(60) = "通知" strURI(60) = "privacy-notifications" strTitle(61) = "音声認識、手書き入力、入力の設定" strURI(61) = "privacy-speechtyping" strTitle(62) = "アカウント情報" strURI(62) = "privacy-accountinfo" strTitle(63) = "連絡先" strURI(63) = "privacy-contacts" strTitle(64) = "カレンダー" strURI(64) = "privacy-calendar" strTitle(65) = "通話履歴" strURI(65) = "privacy-callhistory" strTitle(66) = "メール" strURI(66) = "privacy-email" strTitle(67) = "タスク" strURI(67) = "privacy-tasks" strTitle(68) = "メッセージング" strURI(68) = "messaging" strTitle(69) = "無線" strURI(69) = "privacy-radios" strTitle(70) = "他のデバイス" strURI(70) = "privacy-customdevices" strTitle(71) = "フィードバックと診断" strURI(71) = "privacy-feedback" strTitle(72) = "バック グラウンド アプリ" strURI(72) = "privacy-backgroundapps" strTitle(73) = "アプリの診断" strURI(73) = "privacy-appdiagnostics" For y = 56 to 73 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** 更新とセキュリティ *** myFolder = myRoot & "\11_更新とセキュリティ" strTitle(74) = "Windows Update" strURI(74) = "windowsupdate" strTitle(75) = "Windows Defender" strURI(75) = "windowsdefender" strTitle(76) = "バックアップ" strURI(76) = "backup" strTitle(77) = "トラブルシューティング" strURI(77) = "troubleshoot" strTitle(78) = "回復" strURI(78) = "recovery" strTitle(79) = "ライセンス認証" strURI(79) = "activation" strTitle(80) = "デバイスの検索" strURI(80) = "findmydevice" strTitle(81) = "開発者向け" strURI(81) = "developers" strTitle(82) = "Windows Insider Program" strURI(82) = "windowsinsider" For y = 74 to 82 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next strFile = "%windir%\explorer.exe" '*** Windows Update *** myFolder = myRoot Title = "Windows Update" strArguments = Content & "AAA_SettingsPageRestoreMusUpdate" & ".settingcontent-ms" strIcon = "%SystemRoot%\System32\shell32.dll, 46" If objFSO.FileExists(strArguments) Then MySC End If '*** ネットワーク接続 *** myFolder = myRoot Title = "ネットワーク接続" strArguments = Content & "Classic_{9EF86966-2F35-49BE-A9F6-398E0B844411}" & ".settingcontent-ms" strIcon = "%SystemRoot%\System32\netshell.dll, 0" If objFSO.FileExists(strArguments) Then MySC End If '*** ネットワークと共有センター *** myFolder = myRoot Title = "ネットワークと共有センター" strArguments = Content & "Classic_{BD256B65-94BE-4194-84BF-41D50D0EF26E}" & ".settingcontent-ms" strIcon = "%SystemRoot%\System32\netcenter.dll, 0" If objFSO.FileExists(strArguments) Then MySC End If '*** コントロール パネル *** 'myFolder = myRoot 'Title = "コントロール パネル" 'strArguments = Content & "ControlPanel" & ".settingcontent-ms" 'strIcon = "%SystemRoot%\System32\shell32.dll, 21" 'MySC '*** コントロール パネル *** myFolder = myRoot Title = "コントロール パネル" strFile = "%windir%\System32\control.exe" strArguments = "" strIcon = "%SystemRoot%\System32\shell32.dll, 21" MySC '*** Windows Defender セキュリティ センター *** Title = "Windows Defender セキュリティ センター" strFile = "%windir%\explorer.exe" strArguments = "shell:AppsFolder\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" strIcon = "%ProgramFiles%\Windows Defender\MSASCui.exe, 0" MySC '*** GodMode *** 'strFolder = myRoot 'Title = "GodMode" 'strFolder = myRoot & "\" & Title 'strCLSID = "{ED7BA470-8E54-465E-825C-99712043E01C}" 'strIcon = "%SystemRoot%\system32\shell32.dll, 207" 'If Not objFSO.FolderExists(strFolder) Then ' MyCreateFolder 'End If '*** GodMode (リンク) *** 'Title = "GodMode (リンク)" 'strArguments = myRoot & "\" & "GodMode" 'strIcon = "%SystemRoot%\system32\shell32.dll, 207" 'MySC Kakunin = MsgBox ("終了です YO!", 64 ,"クマー! (´・ω・`) ") Set objTxt = Nothing Set objFSO = Nothing Set objShortcut = Nothing Set objShell = Nothing '********************************************************* 'Sub MyKakunin '********************************************************* Sub MyKakunin Kakunin = MsgBox (" 設定ショートカットを作りますのん? (´・ω・`)", 65 ,"設定ショートカットを作るYO! (´・ω・`) ") If Kakunin = 2 Then WScript.Quit End If End Sub '********************************************************* ' Sub MySC '********************************************************* Sub MySC strShortCut = myFolder & "\" & Title & ".lnk" '*** ショートカットオブジェクトを作成 *** Set objShortCut = objShell.CreateShortcut(strShortCut) With objShortCut ' リンク先 .TargetPath = strFile ' 作業フォルダ .WorkingDirectory = strWorkingDirectory ' 引数 .Arguments = strArguments ' コメント .Description = "" ' アイコン .IconLocation = strIcon End With objShortCut.Save ''WScript.Echo strFileName & "にショートカットを作成しました。" 'MsgBox "ショートカットを作成しました YO!" & vbcrlf & vbcrlf & Title,64 ,"(´・ω・`) クマー! " End Sub '********************************************************* '* Sub MyCreateFolder '********************************************************* Sub MyCreateFolder 'フォルダが存在するなら何もしない、なければ作成 If Not objFSO.FolderExists(strFolder) Then objFSO.CreateFolder strFolder End If ' desktop.ini 作成 strINI = strFolder & "\" & INIFile Set objTxt = objFSO.OpenTextFile(strINI, ForWriting, true, -2) objTxt.WriteLine "[.ShellClassInfo]" objTxt.WriteLine "CLSID=" & strCLSID objTxt.Close 'ファイルにシステム・隠し属性 Set objFile = objFSO.GetFile(strINI) objFile.Attributes = objFile.Attributes + 6 'フォルダ属性 Set objFolder = objFSO.GetFolder(strFolder) 'フォルダにシステム属性 objFolder.Attributes = objFolder.Attributes + 4 'フォルダにシステム&隠し属性 'objFolder.Attributes = objFolder.Attributes + 6 End Sub