'================================================================== ' Windows 10 の「設定」ショートカットを作成しますYO! 'https://diary.palm84.com/entry/20221022/1666414800 'https://eu7w9wsmf6a74xyjdfzl3q-on.drv.tw/archives/wsh/Win10-22H2_CreateMsSettingsShortCut.vbs.txt 'https://drive.google.com/file/d/1-8T6siTHc_rUJ0jJgZk18zAgUPfg-yYW/view '================================================================== '2022.10.22 Windows 10 バージョン22H2対応 「Surface Hub」追加以外はバージョンチェックのみで変更なし '2022.03.24 Windows 10 November 2021 Update(バージョン21H2)対応、「Mixed Reality (複合現実)」追加以外は変更なし '2021.05.28 Windows 10 May 2021 Update(バージョン21H1)対応、内容は変更なし '2020.12.22 Windows 10 October 2020 Update(バージョン20H2)対応 'Shell オブジェクトを作成 Set objShell = WScript.CreateObject("WScript.Shell") 'FileSystemObject オブジェクトを作成 Set objFSO = WScript.CreateObject("Scripting.FileSystemObject") Const Reg_CurrentBuildNumber = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber" Const Reg_ProductName = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName" Const Reg_DisplayVersion = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DisplayVersion" Const Scheme = "ms-settings:" Const ForReading = 1, ForWriting = 2, ForAppending = 8 Const INIFile = "desktop.ini" '*** OSバージョン取得 *** myOS = regOS() If Not myOS = "Windows 10" Then MsgBox "Windows 10 専用クマー (´;ω;`) ",48 ,"I am Sorry, ヒゲソ..(ry" WScript.Quit End If myDisplayVersion = objShell.RegRead(Reg_DisplayVersion) If Not myDisplayVersion = "22H2" And Not myDisplayVersion = "21H2" And Not myDisplayVersion = "21H1" And Not myDisplayVersion = "20H2" Then MsgBox "バージョン20H2 - 21H1 - 21H2 - 22H2 専用クマー (´;ω;`) ",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(14) arrCategory(0) = "01_システム" arrCategory(1) = "02_デバイス" arrCategory(2) = "03_電話" arrCategory(3) = "04_ネットワークとインターネット" 'arrCategory(3) = "パーソナル設定" arrCategory(4) = "05_個人用設定" arrCategory(5) = "06_アプリ" arrCategory(6) = "07_アカウント" arrCategory(7) = "08_時刻と言語" arrCategory(8) = "09_ゲーム" arrCategory(9) = "10_簡単操作" arrCategory(10) = "11_検索" 'arrCategory(11) = "12_Cortana" arrCategory(11) = "12_プライバシー" arrCategory(12) = "13_更新とセキュリティ" arrCategory(13) = "zz_Mixed Reality (複合現実)" arrCategory(14) = "zz_Surface Hub" For x = 0 To 14 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(119), strURI(119) ' strTitle(xx) = "" ' strURI(xx) = "" '*** システム *** myFolder = myRoot & "\01_システム" strTitle(0) = "01-ディスプレイ" strURI(0) = "display" strTitle(1) = "02-サウンド" strURI(1) = "sound" strTitle(2) = "03-通知とアクション" strURI(2) = "notifications" strTitle(3) = "04-集中モード" strURI(3) = "quiethours" strTitle(4) = "05-電源とスリープ" strURI(4) = "powersleep" strTitle(5) = "06-バッテリー" strURI(5) = "batterysaver" strTitle(6) = "07-記憶域" strURI(6) = "storagesense" strTitle(7) = "08-タブレット" strURI(7) = "tabletmode" strTitle(8) = "09-マルチタスク" strURI(8) = "multitasking" strTitle(9) = "10-この PC へのプロジェクション" strURI(9) = "project" strTitle(10) = "11-共有エクスペリエンス" strURI(10) = "crossdevice" strTitle(11) = "12-クリップボード" strURI(11) = "clipboard" strTitle(12) = "13-リモート デスクトップ" strURI(12) = "remotedesktop" strTitle(13) = "14-詳細情報" strURI(13) = "about" For y = 0 to 13 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** デバイス *** myFolder = myRoot & "\02_デバイス" strTitle(14) = "01-Bluetooth とその他のデバイス" strURI(14) = "bluetooth" strTitle(15) = "02-プリンタとスキャナー" strURI(15) = "printers" strTitle(16) = "03-マウス" strURI(16) = "mousetouchpad" strTitle(17) = "04-タッチパッド" strURI(17) = "devices-touchpad" strTitle(18) = "05-入力" strURI(18) = "typing" strTitle(19) = "06-ペンと Windows Ink" strURI(19) = "pen" strTitle(20) = "07-自動再生" strURI(20) = "autoplay" strTitle(21) = "08-USB" strURI(21) = "usb" For y = 14 to 21 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** 電話 *** myFolder = myRoot & "\03_電話" strTitle(22) = "電話" strURI(22) = "mobile-devices" Title = strTitle(22) strFile = Scheme & strURI(22) MySC 'For y = 18 to 18 ' If strTitle(y) <> "" Then ' Title = strTitle(y) ' strFile = Scheme & strURI(y) ' MySC ' End If 'Next '*** ネットワークとインターネット *** myFolder = myRoot & "\04_ネットワークとインターネット" strTitle(23) = "01-状態" strURI(23) = "network-status" strTitle(24) = "02-Wi-Fi" strURI(24) = "network-wifi" strTitle(25) = "03-イーサネット" strURI(25) = "network-ethernet" strTitle(26) = "04-ダイヤルアップ" strURI(26) = "network-dialup" strTitle(27) = "05-VPN" strURI(27) = "network-vpn" strTitle(28) = "06-機内モード" strURI(28) = "network-airplanemode" strTitle(29) = "07-モバイル ホットスポット" strURI(29) = "network-mobilehotspot" strTitle(30) = "08-プロキシ" strURI(30) = "network-proxy" For y = 23 to 30 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** 個人用設定 *** myFolder = myRoot & "\05_個人用設定" strTitle(31) = "01-背景" strURI(31) = "personalization-background" strTitle(32) = "02-色" strURI(32) = "colors" strTitle(33) = "03-ロック画面" strURI(33) = "lockscreen" strTitle(34) = "04-テーマ" strURI(34) = "themes" strTitle(35) = "05-フォント" strURI(35) = "fonts" strTitle(36) = "06-スタート" strURI(36) = "personalization-start" strTitle(37) = "07-タスクバー" strURI(37) = "taskbar" For y = 31 to 37 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** アプリ *** myFolder = myRoot & "\06_アプリ" strTitle(38) = "01-アプリと機能" strURI(38) = "appsfeatures" strTitle(39) = "02-既定のアプリ" strURI(39) = "defaultapps" strTitle(40) = "03-オフライン マップ" strURI(40) = "maps" strTitle(41) = "04-Web サイト用のアプリ" strURI(41) = "appsforwebsites" strTitle(42) = "05-ビデオの再生" strURI(42) = "videoplayback" strTitle(43) = "06-スタートアップ" strURI(43) = "startupapps" For y = 38 to 43 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** アカウント *** myFolder = myRoot & "\07_アカウント" strTitle(44) = "01-ユーザーの情報" strURI(44) = "yourinfo" strTitle(45) = "02-メールとアカウント" strURI(45) = "emailandaccounts" strTitle(46) = "03-サインイン オプション" strURI(46) = "signinoptions" strTitle(47) = "04-職場または学校にアクセスする" strURI(47) = "workplace" strTitle(48) = "05-家族とその他のユーザー" strURI(48) = "otherusers" strTitle(49) = "06-設定の同期" strURI(49) = "sync" For y = 44 to 49 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** 時刻と言語 *** myFolder = myRoot & "\08_時刻と言語" strTitle(50) = "01-日付と時刻" strURI(50) = "dateandtime" strTitle(51) = "02-地域" strURI(51) = "regionformatting" strTitle(52) = "03-言語" strURI(52) = "regionlanguage" strTitle(53) = "04-音声認識" strURI(53) = "speech" For y = 50 to 53 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** ゲーム *** myFolder = myRoot & "\09_ゲーム" strTitle(54) = "01-Xbox Game Bar" strURI(54) = "gaming-gamebar" strTitle(55) = "02-キャプチャ" strURI(55) = "gaming-gamedvr" strTitle(56) = "03-ゲーム モード" strURI(56) = "gaming-gamemode" strTitle(57) = "04-Xbox ネットワーク" strURI(57) = "gaming-xboxnetworking" For y = 54 to 57 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** 簡単操作 *** myFolder = myRoot & "\10_簡単操作" strTitle(58) = "01-ディスプレイ" strURI(58) = "easeofaccess-display" strTitle(59) = "02-マウス ポインター" strURI(59) = "easeofaccess-MousePointer" strTitle(60) = "03-テキスト カーソル" strURI(60) = "easeofaccess-cursor" strTitle(61) = "04-拡大鏡" strURI(61) = "easeofaccess-magnifier" strTitle(62) = "05-カラーフィルター" strURI(62) = "easeofaccess-colorfilter" strTitle(63) = "06-ハイ コントラスト" strURI(63) = "easeofaccess-highcontrast" strTitle(64) = "07-ナレーター" strURI(64) = "easeofaccess-narrator" strTitle(65) = "08-オーディオ" strURI(65) = "easeofaccess-audio" strTitle(66) = "09-字幕" strURI(66) = "easeofaccess-closedcaptioning" strTitle(67) = "10-音声認識" strURI(67) = "easeofaccess-speechrecognition" strTitle(68) = "11-キーボード" strURI(68) = "easeofaccess-keyboard" strTitle(69) = "12-マウス" strURI(69) = "easeofaccess-mouse" strTitle(70) = "13-視線制御" strURI(70) = "easeofaccess-eyecontrol" For y = 58 to 70 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** 検索 *** myFolder = myRoot & "\11_検索" strTitle(71) = "01-アクセス許可と履歴" strURI(71) = "search-permissions" strTitle(72) = "02-Windows の検索" strURI(72) = "cortana-windowssearch" For y = 71 to 72 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** Cortana *** 'myFolder = myRoot & "\12_Cortana" 'strURI(76) = "cortana" 'strTitle(76) = "01-Cortana に話しかける" 'strTitle(77) = "02-アクセス許可" 'strURI(77) = "cortana-permissions" 'strTitle(78) = "03-詳細情報" 'strURI(78) = "cortana-moredetails" 'For y = 76 to 78 ' If strTitle(y) <> "" Then ' Title = strTitle(y) ' strFile = Scheme & strURI(y) ' MySC ' End If 'Next '*** プライバシー *** myFolder = myRoot & "\12_プライバシー" strTitle(73) = "01-全般" strURI(73) = "privacy" strTitle(74) = "02-音声認識" strURI(74) = "privacy-speech" strTitle(75) = "03-手書き入力と入力の個人用設定" strURI(75) = "privacy-speechtyping" strTitle(76) = "04-診断 & フィードバック" strURI(76) = "privacy-feedback" strTitle(77) = "05-アクティビティの履歴" strURI(77) = "privacy-activityhistory" strTitle(78) = "06-位置情報" strURI(78) = "privacy-location" strTitle(79) = "07-カメラ" strURI(79) = "privacy-webcam" strTitle(80) = "08-マイク" strURI(80) = "privacy-microphone" strTitle(81) = "09-音声によるアクティブ化" strURI(81) = "privacy-voiceactivation" strTitle(82) = "10-通知" strURI(82) = "privacy-notifications" strTitle(83) = "11-アカウント情報" strURI(83) = "privacy-accountinfo" strTitle(84) = "12-連絡先" strURI(84) = "privacy-contacts" strTitle(85) = "13-カレンダー" strURI(85) = "privacy-calendar" strTitle(86) = "14-電話をかける" strURI(86) = "privacy-phonecalls" strTitle(87) = "15-通話履歴" strURI(87) = "privacy-callhistory" strTitle(88) = "16-メール" strURI(88) = "privacy-email" strTitle(89) = "17-タスク" strURI(89) = "privacy-tasks" strTitle(90) = "18-メッセージング" strURI(90) = "privacy-messaging" strTitle(91) = "19-無線" strURI(91) = "privacy-radios" strTitle(92) = "20-他のデバイス" strURI(92) = "privacy-customdevices" strTitle(93) = "21-バックグラウンド アプリ" strURI(93) = "privacy-backgroundapps" strTitle(94) = "22-アプリの診断" strURI(94) = "privacy-appdiagnostics" strTitle(95) = "23-ファイルの自動ダウンロード" strURI(95) = "privacy-automaticfiledownloads" strTitle(96) = "24-ドキュメント" strURI(96) = "privacy-documents" strTitle(97) = "25-ピクチャ" strURI(97) = "privacy-pictures" strTitle(98) = "26-ビデオ" strURI(98) = "privacy-videos" strTitle(99) = "27-ファイルシステム" strURI(99) = "privacy-broadfilesystemaccess" For y = 73 to 99 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** 更新とセキュリティ *** myFolder = myRoot & "\13_更新とセキュリティ" strTitle(100) = "01-Windows Update" strURI(100) = "windowsupdate" strTitle(101) = "02-配信の最適化" strURI(101) = "delivery-optimization" strTitle(102) = "03-Windows セキュリティ" strURI(102) = "windowsdefender" strTitle(103) = "04-バックアップ" strURI(103) = "backup" strTitle(104) = "05-トラブルシューティング" strURI(104) = "troubleshoot" strTitle(105) = "06-回復" strURI(105) = "recovery" strTitle(106) = "07-ライセンス認証" strURI(106) = "activation" strTitle(107) = "08-デバイスの検索" strURI(107) = "findmydevice" strTitle(108) = "09-開発者向け" strURI(108) = "developers" strTitle(109) = "10-Windows Insider Program" strURI(109) = "windowsinsider" For y = 100 to 109 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** Mixed Reality (複合現実) *** myFolder = myRoot & "\zz_Mixed Reality (複合現実)" strTitle(110) = "01-オーディオと音声認識" strURI(110) = "holographic-audio" strTitle(111) = "02-環境" strURI(111) = "privacy-holographic-environment" strTitle(112) = "03-ヘッドセット ディスプレイ" strURI(112) = "holographic-headset" strTitle(113) = "04-[アンインストール]" strURI(113) = "holographic-management" strTitle(114) = "05-スタートアップとデスクトップ" strURI(114) = "holographic-startupandesktop" For y = 110 to 114 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** Surface Hub *** myFolder = myRoot & "\zz_Surface Hub" strTitle(115) = "01-アカウント" strURI(115) = "surfacehub-accounts" strTitle(116) = "02-セッションのクリーンアップ" strURI(116) = "surfacehub-sessioncleanup" strTitle(117) = "03-チーム会議" strURI(117) = "surfacehub-calling" strTitle(118) = "04-チーム デバイス管理" strURI(118) = "surfacehub-devicemanagenent" strTitle(119) = "05-[ようこそ] 画面" strURI(119) = "surfacehub-welcome" For y = 115 to 119 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" strFile = Scheme & "windowsupdate" strIcon = "%SystemRoot%\System32\shell32.dll, 46" MySC '*** ネットワーク接続 *** 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 'Else strFile = "%windir%\system32\control.exe" strArguments = "ncpa.cpl" 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 'Else strFile = "%windir%\system32\control.exe" strArguments = "/name Microsoft.NetworkAndSharingCenter" 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 セキュリティ *** 'Title = "Windows Defender セキュリティ センター" Title = "Windows セキュリティ" strFile = "%windir%\explorer.exe" strArguments = "shell:AppsFolder\Microsoft.Windows.SecHealthUI_cw5n1h2txyewy!SecHealthUI" strIcon = "%ProgramFiles%\Windows Defender\Offline\OfflineScannerShell.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 '********************************************************* '* Function regOS '********************************************************* Function regOS() regOS = objShell.RegRead(Reg_ProductName) If objShell.RegRead(Reg_CurrentBuildNumber) >= "22000" Then regOS = "Windows 11" ElseIf InStr(regOS, "Windows 10") > 0 Then regOS = "Windows 10" ElseIf InStr(regOS, "Windows 8") > 0 Then regOS = "Windows 8" ElseIf InStr(regOS, "Windows 7") > 0 Then regOS = "Windows 7" End If 'WScript.Echo myOS End Function '********************************************************* ' Sub MyKakunin '********************************************************* Sub MyKakunin Kakunin = MsgBox (myOS & " バージョン " & myDisplayVersion & vbCrLf & "設定ショートカットを作りますのん? (´・ω・`)", 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