'================================================================== ' Windows 11 22H2 の「設定」ショートカットを作成しますYO! 'https://diary.palm84.com/entry/20220925/1664072079 'https://eu7w9wsmf6a74xyjdfzl3q-on.drv.tw/archives/wsh/Win11-22H2_CreateMsSettingsShortCut.vbs.txt 'https://drive.google.com/file/d/1-2VNHTHaaDke-MQnfbdFfzoAhatF-4AW/ '================================================================== '2022.09.29 Windows 11 バージョン 21H1, 22H2 両対応 '2022.09.25 Windows 11 バージョン 22H2 対応 '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 11" Then MsgBox "Windows 11 専用クマー (´;ω;`) ",48 ,"I am Sorry, ヒゲソ..(ry" WScript.Quit End If myDisplayVersion = objShell.RegRead(Reg_DisplayVersion) If Not myDisplayVersion = "22H2" And Not myDisplayVersion = "21H2" Then MsgBox "バージョン 21H2 or 22H2 専用クマー (´;ω;`) ",48 ,"I am Sorry, ヒゲソ..(ry" WScript.Quit End If 'Wscript.Echo myOS & " バージョン " & myDisplayVersion 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(13) arrCategory(0) = "01_システム" arrCategory(1) = "02_Bluetooth とデバイス" 'arrCategory(2) = "03_電話" arrCategory(2) = "03_ネットワークとインターネット" 'arrCategory(3) = "パーソナル設定" arrCategory(3) = "04_個人用設定" arrCategory(4) = "05_アプリ" arrCategory(5) = "06_アカウント" arrCategory(6) = "07_時刻と言語" arrCategory(7) = "08_ゲーム" arrCategory(8) = "09_アクセシビリティ" 'arrCategory(10) = "11_検索" 'arrCategory(11) = "12_Cortana" arrCategory(9) = "10_プライバシーとセキュリティ" arrCategory(10) = "11_Windows Update" arrCategory(11) = "zz_Mixed Reality (複合現実)" arrCategory(12) = "zz_Surface Hub" For x = 0 To 13 dirCategory = myRoot & "\" & arrCategory(x) If Not objFSO.FolderExists(dirCategory) Then objFSO.CreateFolder(dirCategory) End If Next '*** 設定 *** myFolder = myRoot Title = "設定" strFile = Scheme strWorkingDirectory = "" If myOS = "Windows 11" Then strIcon = "%SystemRoot%\System32\shell32.dll, 314" Else strIcon = "%SystemRoot%\System32\shell32.dll, 316" End If MySC '*** xxxxx *** Dim strTitle(135), strURI(135) ' strTitle(xx) = "" ' strURI(xx) = "" '*** システム *** myFolder = myRoot & "\01_システム" 'strTitle(0) = "00-システム" 'strURI(0) = "" strTitle(1) = "01-ディスプレイ" strURI(1) = "display" strTitle(2) = "02-サウンド" strURI(2) = "sound" strTitle(3) = "03-通知" strURI(3) = "notifications" If myDisplayVersion = "22H2" Then strTitle(4) = "04-フォーカス" ElseIF myDisplayVersion = "21H2" Then strTitle(4) = "04-集中モード" End If strURI(4) = "quiethours" strTitle(5) = "05-電源" strURI(5) = "powersleep" strTitle(6) = "06-バッテリー" strURI(6) = "batterysaver" strTitle(7) = "07-記憶域" strURI(7) = "storagesense" strTitle(8) = "08-タブレット" strURI(8) = "tabletmode" If myDisplayVersion = "22H2" Then strTitle(9) = "09-近距離共有" strURI(9) = "crossdevice" strTitle(10) = "10-マルチタスク" strURI(10) = "multitasking" strTitle(11) = "11-ライセンス認証" strURI(11) = "activation" strTitle(12) = "12-トラブルシューティング" strURI(12) = "troubleshoot" strTitle(13) = "13-回復" strURI(13) = "recovery" strTitle(14) = "14-この PC へのプロジェクション" strURI(14) = "project" strTitle(15) = "15-リモート デスクトップ" strURI(15) = "remotedesktop" strTitle(16) = "16-クリップボード" strURI(16) = "clipboard" strTitle(17) = "17-バージョン情報" strURI(17) = "about" ElseIF myDisplayVersion = "21H2" Then strTitle(10) = "09-マルチタスク" strURI(10) = "multitasking" strTitle(11) = "10-ライセンス認証" strURI(11) = "activation" strTitle(12) = "11-トラブルシューティング" strURI(12) = "troubleshoot" strTitle(13) = "12-回復" strURI(13) = "recovery" strTitle(14) = "13-この PC へのプロジェクション" strURI(14) = "project" strTitle(15) = "14-リモート デスクトップ" strURI(15) = "remotedesktop" strTitle(16) = "15-クリップボード" strURI(16) = "clipboard" strTitle(17) = "16-バージョン情報" strURI(17) = "about" End If For y = 0 to 17 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** Bluetooth とデバイス *** myFolder = myRoot & "\02_Bluetooth とデバイス" If myDisplayVersion = "22H2" Then strTitle(18) = "00-Bluetooth とデバイス" strURI(18) = "devices" End If strTitle(19) = "01-デバイス" strURI(19) = "bluetooth" strTitle(20) = "02-プリンターとスキャナー" strURI(20) = "printers" strTitle(21) = "03-スマートフォン連携" strURI(21) = "mobile-devices" strTitle(22) = "04-カメラ" strURI(22) = "camera" strTitle(23) = "05-マウス" strURI(23) = "mousetouchpad" strTitle(24) = "06-ペンと Windows Ink" strURI(24) = "pen" strTitle(25) = "07-自動再生" strURI(25) = "autoplay" strTitle(26) = "08-USB" strURI(26) = "usb" 'strTitle(17) = "04-タッチパッド" 'strURI(17) = "devices-touchpad" 'strTitle(18) = "05-入力" 'strURI(18) = "typing" For y = 18 to 26 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** ネットワークとインターネット *** myFolder = myRoot & "\03_ネットワークとインターネット" strTitle(27) = "00-ネットワークとインターネット" strURI(27) = "network" strTitle(28) = "01-Wi-Fi" strURI(28) = "network-wifi" strTitle(29) = "02-イーサネット" strURI(29) = "network-ethernet" strTitle(30) = "03-VPN" strURI(30) = "network-vpn" strTitle(31) = "04-モバイル ホットスポット" strURI(31) = "network-mobilehotspot" strTitle(32) = "05-機内モード" strURI(32) = "network-airplanemode" strTitle(33) = "06-プロキシ" strURI(33) = "network-proxy" strTitle(34) = "07-ダイヤルアップ" strURI(34) = "network-dialup" strTitle(35) = "08-ネットワークの詳細設定" strURI(35) = "network-advancedsettings" For y = 27 to 35 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** 個人用設定 *** myFolder = myRoot & "\04_個人用設定" strTitle(36) = "00-個人用設定" strURI(36) = "personalization" strTitle(37) = "01-背景" strURI(37) = "personalization-background" strTitle(38) = "02-色" strURI(38) = "personalization-colors" strTitle(39) = "03-テーマ" strURI(39) = "themes" strTitle(40) = "04-ロック画面" strURI(40) = "personalization-lockscreen" 'strTitle(38) = "05-タッチ キーボード" 'strURI(38) = "personalization-touchkeyboard" If myDisplayVersion = "22H2" Then strTitle(41) = "05-テキスト入力" strURI(41) = "personalization-textinput" ElseIF myDisplayVersion = "21H2" Then strTitle(41) = "05-タッチ キーボード" strURI(41) = "personalization-touchkeyboard" End If strTitle(42) = "06-スタート" strURI(42) = "personalization-start" strTitle(43) = "07-タスクバー" strURI(43) = "taskbar" strTitle(44) = "08-フォント" strURI(44) = "fonts" strTitle(45) = "09-デバイスの使用状況" strURI(45) = "deviceusage" For y = 36 to 45 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** アプリ *** myFolder = myRoot & "\05_アプリ" 'strTitle(44) = "00-アプリ" 'strURI(44) = "" If myDisplayVersion = "22H2" Then strTitle(46) = "01-インストールされているアプリ" strURI(46) = "installed-apps" strTitle(47) = "02-アプリの詳細設定" strURI(47) = "advanced-apps" strTitle(48) = "03-既定のアプリ" strURI(48) = "defaultapps" strTitle(49) = "04-オフライン マップ" strURI(49) = "maps" strTitle(50) = "05-オプション機能" strURI(50) = "optionalfeatures" strTitle(51) = "06-Web サイト用のアプリ" strURI(51) = "appsforwebsites" strTitle(52) = "07-ビデオの再生" strURI(52) = "videoplayback" strTitle(53) = "08-スタートアップ" strURI(53) = "startupapps" ElseIF myDisplayVersion = "21H2" Then strTitle(46) = "01-アプリと機能" strURI(46) = "appsfeatures" ' strTitle(47) = "02-アプリの詳細設定" ' strURI(47) = "advanced-apps" strTitle(48) = "02-既定のアプリ" strURI(48) = "defaultapps" strTitle(49) = "03-オフライン マップ" strURI(49) = "maps" strTitle(50) = "04-オプション機能" strURI(50) = "optionalfeatures" strTitle(51) = "05-Web サイト用のアプリ" strURI(51) = "appsforwebsites" strTitle(52) = "06-ビデオの再生" strURI(52) = "videoplayback" strTitle(53) = "07-スタートアップ" strURI(53) = "startupapps" End If For y = 46 to 53 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** アカウント *** myFolder = myRoot & "\06_アカウント" strTitle(54) = "00-アカウント" strURI(54) = "accounts" If myDisplayVersion = "22H2" Then strTitle(55) = "01-ユーザーの情報" strURI(55) = "yourinfo" strTitle(56) = "02-サインイン オプション" strURI(56) = "signinoptions" strTitle(57) = "03-メールとアカウント" strURI(57) = "emailandaccounts" strTitle(58) = "04-家族" strURI(58) = "family-group" strTitle(59) = "05-Windows バックアップ" strURI(59) = "backup" strTitle(60) = "06-他のユーザー" strURI(60) = "otherusers" strTitle(61) = "07-職場または学校へのアクセス" strURI(61) = "workplace" ElseIF myDisplayVersion = "21H2" Then strTitle(55) = "01-ユーザーの情報" strURI(55) = "yourinfo" strTitle(56) = "02-メールとアカウント" strURI(56) = "emailandaccounts" strTitle(57) = "03-サインイン オプション" strURI(57) = "signinoptions" strTitle(58) = "04-家族とその他のユーザー" strURI(58) = "family-group" strTitle(59) = "05-Windows バックアップ" strURI(59) = "backup" strTitle(61) = "06-職場または学校へアクセスする" strURI(61) = "workplace" End If For y = 54 to 61 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** 時刻と言語 *** myFolder = myRoot & "\07_時刻と言語" 'strTitle(59) = "00-時刻と言語" 'strURI(59) = "" strTitle(62) = "01-日付と時刻" strURI(62) = "dateandtime" strTitle(63) = "02-言語と地域" strURI(63) = "regionlanguage" strTitle(64) = "03-入力" strURI(64) = "typing" strTitle(65) = "04-音声認識" strURI(65) = "speech" For y = 62 to 65 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** ゲーム *** myFolder = myRoot & "\08_ゲーム" 'strTitle(63) = "00-ゲーム" 'strURI(63) = "" strTitle(66) = "01-Xbox Game Bar" strURI(66) = "gaming-gamebar" strTitle(67) = "02-キャプチャ" strURI(67) = "gaming-gamedvr" strTitle(68) = "03-ゲーム モード" strURI(68) = "gaming-gamemode" strTitle(69) = "04-Xbox ネットワーク" strURI(69) = "gaming-xboxnetworking" For y = 66 to 69 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** アクセシビリティ *** myFolder = myRoot & "\09_アクセシビリティ" strTitle(70) = "00-アクセシビリティ" strURI(70) = "easeofaccess" strTitle(71) = "01-テキストのサイズ" strURI(71) = "easeofaccess-display" strTitle(72) = "02-視覚効果" strURI(72) = "easeofaccess-visualeffects" strTitle(73) = "03-マウス ポインターとタッチ" strURI(73) = "easeofaccess-MousePointer" strTitle(74) = "04-テキスト カーソル" strURI(74) = "easeofaccess-cursor" strTitle(75) = "05-拡大鏡" strURI(75) = "easeofaccess-magnifier" strTitle(76) = "06-カラーフィルター" strURI(76) = "easeofaccess-colorfilter" strTitle(77) = "07-コントラスト テーマ" strURI(77) = "easeofaccess-highcontrast" strTitle(78) = "08-ナレーター" strURI(78) = "easeofaccess-narrator" strTitle(79) = "09-オーディオ" strURI(79) = "easeofaccess-audio" strTitle(80) = "10-字幕" strURI(80) = "easeofaccess-closedcaptioning" strTitle(81) = "11-音声認識" strURI(81) = "easeofaccess-speechrecognition" strTitle(82) = "12-キーボード" strURI(82) = "easeofaccess-keyboard" strTitle(83) = "13-マウス" strURI(83) = "easeofaccess-mouse" strTitle(84) = "14-視線制御" strURI(84) = "easeofaccess-eyecontrol" For y = 70 to 84 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** プライバシーとセキュリティ *** myFolder = myRoot & "\10_プライバシーとセキュリティ" strTitle(85) = "00-プライバシーとセキュリティ" strURI(85) = "privacy" strTitle(86) = "01-Windows セキュリティ" strURI(86) = "windowsdefender" strTitle(87) = "02-デバイスの検索" strURI(87) = "findmydevice" strTitle(88) = "03-開発者向け" strURI(88) = "developers" strTitle(89) = "04-全般" strURI(89) = "privacy-general" strTitle(90) = "05-音声認識" strURI(90) = "privacy-speech" strTitle(91) = "06-手書き入力と入力の個人用設定" strURI(91) = "privacy-speechtyping" strTitle(92) = "07-診断とフィードバック" strURI(92) = "privacy-feedback" strTitle(93) = "08-アクティビティの履歴" strURI(93) = "privacy-activityhistory" strTitle(94) = "09-検索アクセス許可" strURI(94) = "privacy-search-permissions" strTitle(95) = "10-Windows 検索" strURI(95) = "privacy-search" strTitle(96) = "11-位置情報" strURI(96) = "privacy-location" strTitle(97) = "12-カメラ" strURI(97) = "privacy-webcam" strTitle(98) = "13-マイク" strURI(98) = "privacy-microphone" strTitle(99) = "14-音声によるアクティブ化" strURI(99) = "privacy-voiceactivation" strTitle(100) = "15-通知" strURI(100) = "privacy-notifications" strTitle(101) = "16-アカウント情報" strURI(101) = "privacy-accountinfo" strTitle(102) = "17-連絡先" strURI(102) = "privacy-contacts" strTitle(103) = "18-カレンダー" strURI(103) = "privacy-calendar" strTitle(104) = "19-電話をかける" strURI(104) = "privacy-phonecalls" strTitle(105) = "20-通話履歴" strURI(105) = "privacy-callhistory" strTitle(106) = "21-メール" strURI(106) = "privacy-email" strTitle(107) = "22-タスク" strURI(107) = "privacy-tasks" strTitle(108) = "23-メッセージング" strURI(108) = "privacy-messaging" strTitle(109) = "24-無線" strURI(109) = "privacy-radios" strTitle(110) = "25-他のデバイス" strURI(110) = "privacy-customdevices" strTitle(111) = "26-アプリの診断" strURI(111) = "privacy-appdiagnostics" strTitle(112) = "27-ファイルの自動ダウンロード" strURI(112) = "privacy-automaticfiledownloads" strTitle(113) = "28-ドキュメント" strURI(113) = "privacy-documents" strTitle(114) = "29-ダウンロード フォルダー" strURI(114) = "privacy-downloadsfolder" strTitle(115) = "30-音楽ライブラリ" strURI(115) = "privacy-musiclibrary" strTitle(116) = "31-ピクチャ" strURI(116) = "privacy-pictures" strTitle(117) = "32-ビデオ" strURI(117) = "privacy-videos" strTitle(118) = "33-ファイル システム" strURI(118) = "privacy-broadfilesystemaccess" strTitle(119) = "34-スクリーンショットの境界線" strURI(119) = "privacy-graphicscapturewithoutborder" strTitle(120) = "35-スクリーンショットとアプリ" strURI(120) = "privacy-graphicscaptureprogrammatic" For y = 85 to 120 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next 'strTitle(93) = "21-バックグラウンド アプリ" 'strURI(93) = "privacy-backgroundapps" '*** Windows Update *** myFolder = myRoot & "\11_Windows Update" strTitle(121) = "00-Windows Update" strURI(121) = "windowsupdate" strTitle(122) = "02-更新の履歴" strURI(122) = "windowsupdate-history" strTitle(123) = "03-詳細オプション" strURI(123) = "windowsupdate-options" strTitle(124) = "04-Windows Insider Program" strURI(124) = "windowsinsider" For y = 121 to 124 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** Mixed Reality (複合現実) *** myFolder = myRoot & "\zz_Mixed Reality (複合現実)" strTitle(125) = "00-複合現実" strURI(125) = "holographic" strTitle(126) = "01-オーディオと音声認識" strURI(126) = "holographic-audio" strTitle(127) = "02-環境" strURI(127) = "privacy-holographic-environment" strTitle(128) = "03-ヘッドセット ディスプレイ" strURI(128) = "holographic-headset" strTitle(129) = "04-[アンインストール]" strURI(129) = "holographic-management" strTitle(130) = "05-スタートアップとデスクトップ" strURI(130) = "holographic-startupandesktop" For y = 125 to 130 If strTitle(y) <> "" Then Title = strTitle(y) strFile = Scheme & strURI(y) MySC End If Next '*** Surface Hub *** myFolder = myRoot & "\zz_Surface Hub" strTitle(131) = "01-アカウント" strURI(131) = "surfacehub-accounts" strTitle(132) = "02-セッションのクリーンアップ" strURI(132) = "surfacehub-sessioncleanup" strTitle(133) = "03-チーム会議" strURI(133) = "surfacehub-calling" strTitle(134) = "04-チーム デバイス管理" strURI(134) = "surfacehub-devicemanagenent" strTitle(135) = "05-[ようこそ] 画面" strURI(135) = "surfacehub-welcome" For y = 131 to 135 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" strArguments = "shell:AppsFolder\Microsoft.SecHealthUI_8wekyb3d8bbwe!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