もともと、VBScript( WMI ) を使用して shell: で使用される文字列を全て取得して、動作するものを選択して JavaScript で動くようにしたものです。なので、拡張子が html のものを ActiveX を利用可能にした IE11 で WEB 上で表示しても実行できます。 アプリケーションの実行は、どういうわけか WScript.Shell ではなく Shell.Application を使用したほうが正しく動作しました。
<!DOCTYPE html> <html> <head> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta charset="utf-8"> <meta content="width=device-width initial-scale=1.0 minimum-scale=1.0 maximum-scale=1.0 user-scalable=no" name="viewport"> <title>Windiows のフォルダを開く</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.css"> <style> body { padding: 10px; } .btn { text-align:left; width: 300px; } .desc { margin-left: 20px; } </style> <script language='jscript'> var WshShell = new ActiveXObject("WScript.Shell"); var Shell = new ActiveXObject("Shell.Application"); </script> </head> <body> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:MyComputerFolder' onclick='Shell.Explore("shell:MyComputerFolder")' language='jscript'><span class='desc'>PC</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:ControlPanelFolder' onclick='Shell.Explore("shell:ControlPanelFolder")' language='jscript'><span class='desc'>コントロール パネル\すべてのコントロール パネル項目</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Local Documents' onclick='Shell.Explore("shell:Local Documents")' language='jscript'><span class='desc'>ドキュメント</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:SendTo' onclick='Shell.Explore("shell:SendTo")' language='jscript'><span class='desc'></span>C:\Users\ユーザ名\AppData\Roaming\Microsoft\Windows\SendTo</div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Startup' onclick='Shell.Explore("shell:Startup")' language='jscript'><span class='desc'>C:\Users\ユーザ名\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Common Startup' onclick='Shell.Explore("shell:Common Startup")' language='jscript'><span class='desc'>C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Downloads' onclick='Shell.Explore("shell:Downloads")' language='jscript'><span class='desc'>ダウンロード</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Desktop' onclick='Shell.Explore("shell:Desktop")' language='jscript'><span class='desc'>デスクトップ</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:My Pictures' onclick='Shell.Explore("shell:My Pictures")' language='jscript'><span class='desc'>ピクチャ</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:AppData' onclick='Shell.Explore("shell:AppData")' language='jscript'><span class='desc'>C:\Users\ユーザ名\AppData\Roaming</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Common AppData' onclick='Shell.Explore("shell:Common AppData")' language='jscript'><span class='desc'>C:\ProgramData</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:AppsFolder' onclick='Shell.Explore("shell:AppsFolder")' language='jscript'><span class='desc'>Applications</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:PrintersFolder' onclick='Shell.Explore("shell:PrintersFolder")' language='jscript'><span class='desc'>すべてのコントロール パネル項目\プリンター</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Start Menu' onclick='Shell.Explore("shell:Start Menu")' language='jscript'><span class='desc'>C:\Users\ユーザ名\AppData\Roaming\Microsoft\Windows\Start Menu</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Recent' onclick='Shell.Explore("shell:Recent")' language='jscript'><span class='desc'>C:\Users\ユーザ名\AppData\Roaming\Microsoft\Windows\Recent</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:System' onclick='Shell.Explore("shell:System")' language='jscript'><span class='desc'>C:\Windows\System32</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:SystemX86' onclick='Shell.Explore("shell:SystemX86")' language='jscript'><span class='desc'>C:\Windows\SysWOW64</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Windows' onclick='Shell.Explore("shell:Windows")' language='jscript'><span class='desc'>C:\Windows</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:ProgramFiles' onclick='Shell.Explore("shell:ProgramFiles")' language='jscript'><span class='desc'>C:\Program Files (x86)</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Common Documents' onclick='Shell.Explore("shell:Common Documents")' language='jscript'><span class='desc'>C:\Users\Public\Documents</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Quick Launch' onclick='Shell.Explore("shell:Quick Launch")' language='jscript'><span class='desc'>C:\Users\ユーザ名\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Templates' onclick='Shell.Explore("shell:Templates")' language='jscript'><span class='desc'>C:\Users\ユーザ名\AppData\Roaming\Microsoft\Windows\Templates</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:RecycleBinFolder' onclick='Shell.Explore("shell:RecycleBinFolder")' language='jscript'><span class='desc'>ごみ箱</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Common Administrative Tools' onclick='Shell.Explore("shell:Common Administrative Tools")' language='jscript'><span class='desc'>C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools</span></div> <br><br> <div><input type='button' class='btn btn-outline-primary mb-2' value='C:\Program Files' onclick='Shell.Explore("C:\\Program Files")' language='jscript'><span class='desc'>C:\Program File</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='%TEMP%' onclick='Shell.Explore(WshShell.ExpandEnvironmentStrings("%TEMP%"))' language='jscript'><span class='desc'>C:\Users\ユーザ名\AppData\Local\Temp</span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='hosts のあるフォルダ' onclick='Shell.Explore("C:\\Windows\\System32\\drivers\\etc")' language='jscript'><span class='desc'>C:\Windows\System32\drivers\etc</span></div> <br><br> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:3D Objects' onclick='Shell.Explore("shell:3D Objects")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:AccountPictures' onclick='Shell.Explore("shell:AccountPictures")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:AddNewProgramsFolder' onclick='Shell.Explore("shell:AddNewProgramsFolder")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Administrative Tools' onclick='Shell.Explore("shell:Administrative Tools")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Application Shortcuts' onclick='Shell.Explore("shell:Application Shortcuts")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Cache' onclick='Shell.Explore("shell:Cache")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Camera Roll' onclick='Shell.Explore("shell:Camera Roll")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:CD Burning' onclick='Shell.Explore("shell:CD Burning")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Common Desktop' onclick='Shell.Explore("shell:Common Desktop")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Common Programs' onclick='Shell.Explore("shell:Common Programs")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Common Start Menu' onclick='Shell.Explore("shell:Common Start Menu")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Common Templates' onclick='Shell.Explore("shell:Common Templates")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:CommonDownloads' onclick='Shell.Explore("shell:CommonDownloads")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:CommonMusic' onclick='Shell.Explore("shell:CommonMusic")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:CommonPictures' onclick='Shell.Explore("shell:CommonPictures")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:CommonRingtones' onclick='Shell.Explore("shell:CommonRingtones")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:CommonVideo' onclick='Shell.Explore("shell:CommonVideo")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:ConnectionsFolder' onclick='Shell.Explore("shell:ConnectionsFolder")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Contacts' onclick='Shell.Explore("shell:Contacts")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Cookies' onclick='Shell.Explore("shell:Cookies")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:CredentialManager' onclick='Shell.Explore("shell:CredentialManager")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:CryptoKeys' onclick='Shell.Explore("shell:CryptoKeys")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Device Metadata Store' onclick='Shell.Explore("shell:Device Metadata Store")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:DocumentsLibrary' onclick='Shell.Explore("shell:DocumentsLibrary")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:DpapiKeys' onclick='Shell.Explore("shell:DpapiKeys")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Favorites' onclick='Shell.Explore("shell:Favorites")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Fonts' onclick='Shell.Explore("shell:Fonts")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:GameTasks' onclick='Shell.Explore("shell:GameTasks")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:History' onclick='Shell.Explore("shell:History")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:HomeGroupFolder' onclick='Shell.Explore("shell:HomeGroupFolder")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:ImplicitAppShortcuts' onclick='Shell.Explore("shell:ImplicitAppShortcuts")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Libraries' onclick='Shell.Explore("shell:Libraries")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Links' onclick='Shell.Explore("shell:Links")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Local AppData' onclick='Shell.Explore("shell:Local AppData")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Local Downloads' onclick='Shell.Explore("shell:Local Downloads")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:UsersLibrariesFolder' onclick='Shell.Explore("shell:UsersLibrariesFolder")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Local Music' onclick='Shell.Explore("shell:Local Music")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Local Pictures' onclick='Shell.Explore("shell:Local Pictures")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Local Videos' onclick='Shell.Explore("shell:Local Videos")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:LocalAppDataLow' onclick='Shell.Explore("shell:LocalAppDataLow")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:MusicLibrary' onclick='Shell.Explore("shell:MusicLibrary")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:My Music' onclick='Shell.Explore("shell:My Music")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:My Video' onclick='Shell.Explore("shell:My Video")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:NetHood' onclick='Shell.Explore("shell:NetHood")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:NetworkPlacesFolder' onclick='Shell.Explore("shell:NetworkPlacesFolder")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:OneDrive' onclick='Shell.Explore("shell:OneDrive")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:OneDriveCameraRoll' onclick='Shell.Explore("shell:OneDriveCameraRoll")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:OneDriveDocuments' onclick='Shell.Explore("shell:OneDriveDocuments")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:OneDriveMusic' onclick='Shell.Explore("shell:OneDriveMusic")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:OneDrivePictures' onclick='Shell.Explore("shell:OneDrivePictures")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:PicturesLibrary' onclick='Shell.Explore("shell:PicturesLibrary")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:PrintHood' onclick='Shell.Explore("shell:PrintHood")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Profile' onclick='Shell.Explore("shell:Profile")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:ProgramFilesX86' onclick='Shell.Explore("shell:ProgramFilesX86")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:ProgramFilesCommon' onclick='Shell.Explore("shell:ProgramFilesCommon")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:ProgramFilesCommonX86' onclick='Shell.Explore("shell:ProgramFilesCommonX86")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Programs' onclick='Shell.Explore("shell:Programs")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Public' onclick='Shell.Explore("shell:Public")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:PublicAccountPictures' onclick='Shell.Explore("shell:PublicAccountPictures")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:PublicGameTasks' onclick='Shell.Explore("shell:PublicGameTasks")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:PublicLibraries' onclick='Shell.Explore("shell:PublicLibraries")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:ResourceDir' onclick='Shell.Explore("shell:ResourceDir")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Roaming Tiles' onclick='Shell.Explore("shell:Roaming Tiles")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:Ringtones' onclick='Shell.Explore("shell:Ringtones")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:SavedGames' onclick='Shell.Explore("shell:SavedGames")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:SavedPictures' onclick='Shell.Explore("shell:SavedPictures")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:SavedPicturesLibrary' onclick='Shell.Explore("shell:SavedPicturesLibrary")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Screenshots' onclick='Shell.Explore("shell:Screenshots")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:Searches' onclick='Shell.Explore("shell:Searches")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:SearchHomeFolder' onclick='Shell.Explore("shell:SearchHomeFolder")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:SystemCertificates' onclick='Shell.Explore("shell:SystemCertificates")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:ThisDeviceFolder' onclick='Shell.Explore("shell:ThisDeviceFolder")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:ThisPCDesktopFolder' onclick='Shell.Explore("shell:ThisPCDesktopFolder")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:User Pinned' onclick='Shell.Explore("shell:User Pinned")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:UserProfiles' onclick='Shell.Explore("shell:UserProfiles")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:UserProgramFiles' onclick='Shell.Explore("shell:UserProgramFiles")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:UserProgramFilesCommon' onclick='Shell.Explore("shell:UserProgramFilesCommon")' language='jscript'><span class='desc'></span> <input type='button' class='btn btn-outline-primary mb-2' value='shell:UsersFilesFolder' onclick='Shell.Explore("shell:UsersFilesFolder")' language='jscript'><span class='desc'></span></div> <div><input type='button' class='btn btn-outline-primary mb-2' value='shell:VideosLibrary' onclick='Shell.Explore("shell:VideosLibrary")' language='jscript'><span class='desc'></span></div> </body> </html>
IE11 の設定 このページの PDF
|
【HTA ( HTMLアプリケーション )の最新記事】
- HTA / ADO / Jscript : Access( .accdb .mdb ) の読み込みと表示
- HTML Application : JavaScript で新しい Excel の Book を作成する
- HTA (または IE11) で フォルダ選択ダイアログからフォルダとファイルの一覧
- HTA (または IE11) で hostname を実行して標準出力からPC名の取得
- HTA : 『x-frame-options: SAMEORIGIN』の設定されていないページの情報を IFRAME 内に表示して jQuery で取り出す / iframe内 参照と .clone(..
- HTA (HTMLアプリケーション) で JavaScript と VBScript を混在させる手法 / GetObject を VBScript 側で使用する
- HTA + Basp21 + jQuery + twitter-bootstrap(4.1.1) でメール受信ツール
- HTA + Basp21 + jQuery + twitter-bootstrap(4.1.1) でメール送信ツール