JScript / VBScript : 指定したフォルダ内のフォルダ毎の使用済みサイズを読める範囲でレポートする

▼ JScript のダウンロード

▼ VBScript のダウンロード

System Volume Information は、無駄に使われてる場合が多いそうです。( 今日 5G 削除しました ) ✅ 参考ページ

show-folders-size.js

001.// ************************************************
002.// カンマ編集
003.// ************************************************
004.String.prototype.number_format =
005.function (prefix) {
006.        var num = this.valueOf();
007.        prefix = prefix || '';
008.        num += '';
009.        var splitStr = num.split('.');
010.        var splitLeft = splitStr[0];
011.        var splitRight = splitStr.length > 1 ? '.' + splitStr[1] : '';
012.        var regx = /(\d+)(\d{3})/;
013.        while (regx.test(splitLeft)) {
014.                splitLeft = splitLeft.replace(regx, '$1' + ',' + '$2');
015.        }
016.        return prefix + splitLeft + splitRight;
017.}
018. 
019.// ************************************************
020.// オブジェクト
021.// ************************************************
022.var Shell = new ActiveXObject("Shell.Application");
023.var WshShell = new ActiveXObject("WScript.Shell");
024.var Fso = new ActiveXObject( "Scripting.FileSystemObject" );
025. 
026.// ************************************************
027.// 管理者権限のコマンドプロンプトで再実行
028.// ************************************************
029.if ( WScript.Arguments.length == 0 ) {
030.        Shell.ShellExecute( "cmd.exe", "/c cscript.exe " + Dd(WScript.ScriptFullName) + " next" + " & pause", "", "runas", 1 );
031.        WScript.Quit();
032.}
033. 
034. 
035.var target = SelectDir( "対象フォルダを選択して下さい" )
036.if ( target == "" ) {
037.        WScript.Quit();
038.}
039. 
040.WScript.Echo( target )
041. 
042.// ************************************************
043.// フォルダオブジェクト取得
044.// ************************************************
045.var objFolder =  Fso.GetFolder(target)
046. 
047.var folderCollection = new Enumerator(objFolder.SubFolders);
048. 
049.var TargetSize = 0;
050.var obj;
051.var num;
052.var line;
053.for ( ;!folderCollection.atEnd(); folderCollection.moveNext()) {
054. 
055.        obj = folderCollection.item();
056.         
057.        try {
058.                num = Math.floor(obj.Size / 1024) / 1024;
059.                num = Math.floor( num * 1000 ) / 1000
060.                line = Lpad(("" + num).number_format()," ", 15) + " M : " + obj.Name
061.                WScript.Echo( line );
062. 
063.                // フォルダ全体の合計
064.                TargetSize = TargetSize + obj.Size
065.        }
066.        catch(e) {
067.                WScript.Echo( obj.Name + " : 処理できません");
068.        }
069. 
070.}
071. 
072.WScript.Echo( "" );
073. 
074.num = Math.floor(TargetSize / 1024) / 1024;
075.num = Math.floor( num * 1000 ) / 1000
076.line = Lpad(("" + num).number_format()," ", 15) + " M : " + "表示合計"
077.WScript.Echo( line );
078. 
079.// ************************************************
080.// ディレクトリ選択
081.// ************************************************
082.function SelectDir( strTitle ) {
083. 
084.        var obj
085. 
086.        obj = Shell.BrowseForFolder( 0, strTitle, 0x4B, 0 )
087.        if ( obj == null ) {
088.                return "";
089.        }
090.        if ( !obj.Self.IsFileSystem ) {
091.                ErrorMessage = "ファイルシステムではありません";
092.                return "";
093.        }
094. 
095.        return obj.Self.Path;
096. 
097.}
098. 
099.// ************************************************
100.// ダブルクォートで囲む
101.// ************************************************
102.function Dd( strValue ) {
103. 
104.        return "\"" + strValue + "\""
105. 
106.}
107. 
108.// ************************************************
109.// 指定数、指定文字列左側を埋める
110.// ※少数以下3桁の調整
111.// ************************************************
112.function Lpad( strValue, str, nLen ) {
113. 
114.        var i;
115.        var wk = "";
116. 
117.        for( i = 0; i < nLen; i++ ) {
118.                wk += str;
119.        }
120.         
121.        var test = strValue.split(".");
122.        if ( test.length == 2 ) {
123.                if ( test[1].length == 0 ) {
124.                        strValue += "000"
125.                }
126.                if ( test[1].length == 1 ) {
127.                        strValue += "00"
128.                }
129.                if ( test[1].length == 2 ) {
130.                        strValue += "0"
131.                }
132.        }
133.        else {
134.                strValue += ".000"
135.        }
136. 
137.        return ( wk + strValue ).slice( nLen * -1 );
138. 
139.}


show-folders-size.vbs

001.' ************************************************
002.' 管理者権限で実行用
003.' ************************************************
004.Set Shell = CreateObject( "Shell.Application" )
005. 
006.' ************************************************
007.' 管理者権限で再実行
008.' ************************************************
009.if Wscript.Arguments.Count = 0 then
010.        Shell.ShellExecute "cmd.exe", "/c cscript.exe " & Dd(WScript.ScriptFullName) & " next" & " & pause", "", "runas", 1
011.        Wscript.Quit
012.end if
013. 
014.' ************************************************
015.' 除外フォルダ名を スペースで区切って並べる
016.' (簡易的な除外)
017.' ************************************************
018.Dim Exclude
019.Exclude = ".gem"
020.Exclude = Lcase(Exclude)
021. 
022.' ************************************************
023.' 処理用
024.' ************************************************
025.Set WshShell = CreateObject( "WScript.Shell" )
026.Set Fso = CreateObject( "Scripting.FileSystemObject" )
027. 
028.Dim target
029. 
030.' ************************************************
031.' 対象フォルダを選択
032.' ************************************************
033.target = SelectDir( "対象フォルダを選択して下さい" )
034.if target = "" then
035.        Wscript.Quit
036.end if
037. 
038.Wscript.Echo target
039.Wscript.Echo
040. 
041.' ************************************************
042.' フォルダオブジェクト取得
043.' ************************************************
044.Set objFolder =  Fso.GetFolder(target)
045. 
046.' ************************************************
047.' サブフォルダコレクション取得
048.' ************************************************
049.Set colSubFolder =  objFolder.SubFolders
050. 
051.' ************************************************
052.' 一覧
053.' ************************************************
054.Dim TargetSize : TargetSize = 0
055.For Each obj in colSubFolder
056. 
057.        Do While true
058. 
059.                if InStr(Exclude,Lcase(obj.Name)) > 0 then
060.                        Exit Do
061.                end if
062. 
063.                on error resume next
064.                Wscript.Echo Lpad(FormatNumber((Fix(obj.Size / 1024) / 1024),3)," ", 15) & " M : " & obj.Name
065.                if Err.Number <> 0 then
066.                        Wscript.Echo "                  ( " & obj.Name & " : 処理できません )"
067.                else
068.                        TargetSize = TargetSize + obj.Size
069.                end if
070.                on error goto 0
071. 
072. 
073.                Exit Do
074.        Loop
075. 
076. 
077.Next
078. 
079.Wscript.Echo
080. 
081.Dim AllSize
082.Dim er : er = 0
083.on error resume next
084.AllSize = objFolder.Size
085.if Err.Number <> 0 then
086.        er = 1
087.        AllSize = TargetSize
088.end if
089.on error goto 0
090. 
091. 
092.Wscript.Echo Lpad(FormatNumber((Fix(TargetSize / 1024) / 1024),3)," ", 15) & " M : " & "表示合計"
093. 
094.if er = 1 then
095.        Wscript.Echo "                  ( " & target & " のサイズは取得できませんでした )"
096.else
097.        Wscript.Echo Lpad(FormatNumber((Fix(AllSize / 1024) / 1024),3)," ", 15) & " M : " & target & " のサイズ"
098.end if
099. 
100.Dim fsize : fsize = 0
101.For Each file in objFolder.files
102.        fsize = fsize + file.size
103.Next
104.Wscript.Echo Lpad(FormatNumber((Fix((fsize) / 1024) / 1024),3)," ", 15) & " M : " & target & " 下のファイル"
105. 
106.Wscript.Echo
107. 
108.' ************************************************
109.' ディレクトリ選択
110.' ************************************************
111.Function SelectDir( strTitle )
112. 
113.        Dim obj
114. 
115.        Set obj = Shell.BrowseForFolder( 0, strTitle, &H4B, 0 )
116.        if obj is nothing then
117.                SelectDir = ""
118.                Exit Function
119.        end if
120.        if not obj.Self.IsFileSystem then
121.                ErrorMessage = "ファイルシステムではありません"
122.                SelectDir = ""
123.                Exit Function
124.        end if
125. 
126.        SelectDir = obj.Self.Path
127. 
128.End Function
129. 
130.' ************************************************
131.' ダブルクォートで囲む
132.' ************************************************
133.Function Dd( strValue )
134. 
135.        Dd = """" & strValue & """"
136. 
137.End function
138. 
139.' ************************************************
140.' 指定数、指定文字列左側を埋める
141.' ************************************************
142.Function Lpad( strValue, str, nLen )
143. 
144.        Lpad = Right( String(nLen,str) & strValue, nLen )
145. 
146.End Function




VBScript, ツール

MKEditor 追加設定インストーラ : プロジェクト自動作成スクリプトをエクスプローラの『新規作成』に追加します

MKEditor for Windows のダウンロード( Vector )

まず、MKEditor をインストールしておきます。その後から以下からダウンロードする書庫の中の install.bat を実行させます。





このスクリプトは、MKEditor の追加の設定を自動で行います。実行後、フォルダの選択ダイアログが表示されるので、MKEditor のインストールフォルダを選択して下さい



MKEditor.sck のキー割り当て

1) shift+f1 でアプリケーションで実行
2) shift+ctrl+del で、アイテム削除
3) f2 でボックス、フォルダ、アイテムのプロパティ
4) f4 で、フォルダ作成
5) Shift+f4 でボックス作成
6) Shift+Ctrl+U で 大文字( Upper )
7) Shift+Ctrl+L で 小文字( Lower )
8) Shift+Ctrl+Z で 全角
9) Shift+Ctrl+H で 半角
10) F5 相対パスでリンク
11) Shift+@ でエディタオプション

▼ MKEditor プロジェクトの実行

そのフォルダ内のみ対象とします

▼ MKEditor プロジェクト(全て)の実行 / 下の階層もすべて作成

全てのサブディレクトリも登録します。

但し、それらは常に1階層のディレクトリとしますので、深いツリー構造でも管理しやすくなります。
( 空のディレクトリも登録しますし、CTRL + SHIFT + DEL で削除も容易です )

▼ 対象拡張子の追加

MKEditor のインストール場所に build_mkp.wsf と build_mkp_all.wsf があります。その先頭付近に以下のような記述がありますので、これに追加します。

strList = ""
strList = strList & "CSV,PHP,HTM,TXT,INF,VBS,ASP,INC,WSF,ASA,ASPX,BAS,CSS,JS,SQL,SQLTXT,BAT,PS1,JAVA,JSP,VB,"
strList = strList & "HTA,HTM,HTML,SHTM,SHTML,PL,CGI,C,CPP,H,URL,REG,LOG,AS,MXML,XUL,DTD,PROPERTIES,MANIFEST,RDF,INI,"
strList = strList & "PY,RB,CS,PAS,DPR,TSV,XML,SH"

アンインストール

以下のキーをレジストリから削除してください

HKEY_CLASSES_ROOT\.layla002
HKEY_CLASSES_ROOT\.layla003

エクスプローラを右クリックしてそのフォルダで「コマンドプロント」を開くメニューを追加する( .reg ファイルを実行 )

エクスプローラを右クリックしてコマンドプロンプトを開きたい場合は、以下のレジストリをインポートします(右端のダウンロードアイコンでダウンロード / 拡張子 .reg )
1.Windows Registry Editor Version 5.00
2.  
3.[HKEY_CLASSES_ROOT\Folder\shell\cmd]
4.@="コマンドプロンプト(&Q)"
5.  
6.[HKEY_CLASSES_ROOT\Folder\shell\cmd\command]
7.@="cmd.exe /s /k pushd \"%V\""

HKEY_CLASSES_ROOT\Folder なのがミソです。同様の HKEY_CLASSES_ROOT\Directory は所有者が特殊でいろいろ面倒です

🔻 ショートカットは他とダブらないように Q にしました

🔻 SHIFT キーを押しながら右クリック

🔻 削除は以下です

🔻 インストール場所をレジストリエディタで開くスクリプトをダウンロードします






VBScript : ファイルのパスや名前をクリップボードへ( ダブルクォートなし ) / 送るフォルダに保存

エクスプローラで、SHIFT キーを押しながら右クリックすると『パスとしてコピー』がありますが、ダブルクォートが付加されています( たいていはそのほうがいいのですが )ので、ダブルクォートのないパスを取得します


▼ こんな感じで取得されます
"C:\Program Files\7-Zip\7-zip.dll"

filepath.vbs( SendTo ディレクトリに置いてください )

01.Set WshShell = Wscript.CreateObject("WScript.Shell")
02.Set Fso = Wscript.CreateObject("Scripting.FileSystemObject")
03. 
04.strTemp = WshShell.ExpandEnvironmentStrings("%temp%")
05.strPath = strTemp & "\__clipCommand.tmp"
06. 
07.Set objHandle = Fso.OpenTextFile( strPath, 2, True )
08.objHandle.Write Wscript.Arguments(0)
09. 
10.Call WshShell.Run( "cmd.exe /c clip < """ & strPath & """", 0, True )

▼ こうなります
C:\Program Files\7-Zip\7-zip.dll

以下はディレクトリ部分を省いた名前の部分のみをクリップボードにコピーします。

filename.vbs( SendTo ディレクトリに置いてください )

01.Set WshShell = Wscript.CreateObject("WScript.Shell")
02.Set Fso = Wscript.CreateObject("Scripting.FileSystemObject")
03. 
04.strTemp = WshShell.ExpandEnvironmentStrings("%temp%")
05.strPath = strTemp & "\__clipCommand.tmp"
06. 
07.Set objHandle = Fso.OpenTextFile( strPath, 2, True )
08.strName = Wscript.Arguments(0)
09.aPath = Split(strName,"\")
10.strName = aPath(Ubound(aPath))
11.objHandle.Write strName
12. 
13.Call WshShell.Run( "cmd.exe /c clip < """ & strPath & """", 0, True )

▼ こうなります
7-zip.dll

さらに以下では、複数ファイルを選択した場合のファイル名部分だけを取り出して複数行としてコピーします( 但しあまり大量のファイルは元々の文字列の制限によりエラーとなります

filelist.vbs( SendTo ディレクトリに置いてください )

01.Set WshShell = Wscript.CreateObject("WScript.Shell")
02.Set Fso = Wscript.CreateObject("Scripting.FileSystemObject")
03. 
04.str = ""
05.For I = 0 to Wscript.Arguments.Count-1
06.        aData = Split( Wscript.Arguments(I), "\" )
07.        str = str & aData(Ubound(aData)) & vbCrLf
08.Next
09. 
10.strTemp = WshShell.ExpandEnvironmentStrings("%temp%")
11.strPath = strTemp & "\__clipCommand.tmp"
12. 
13.Set objHandle = Fso.OpenTextFile( strPath, 2, True )
14.objHandle.Write str
15.Call WshShell.Run( "cmd.exe /c clip < """ & strPath & """", 0, True )

▼ ファイルが多すぎて起きるエラー


▼ うまくいくとこんな感じです
nslookup.exe
ntdll.dll
odbc32.dll
ole32.dll


操作補足

エクスプローラで SendTo フォルダに移動するには、アドレスバーに sendto と直接入力します。テンポラリフォルダは、%temp% と入力して下さい。




コードを直接ダウンロードした場合は、右クリックのプロパティより『許可する』にチェックしておきます。






Google 翻訳ブックマークレット

テキストを選択してブックマークレットを実行すると、その部分だけを翻訳し、なにも選択せずにただブックマークレットを実行するとそのページ全体を翻訳します
🔻 以下のリンクをブックマークバーにドロップしてください

Google英→日


Google日→英

Edge の場合は一旦何かのお気に入りを作成してから、上記リンクのコピーを編集で URL に対して置き換える必要があります

🔻 このページの英語翻訳

🔻 Google英→日 のソースコード

1.javascript: (function() {
2.        var b = ((window.getSelection && window.getSelection()) || (document.getSelection && document.getSelection()) || (document.selection && document.selection.createRange && document.selection.createRange().text));
3.        if (b != '') {
4.                window.open('https://translate.google.co.jp/?hl=ja&tab=wT#en/ja/' + encodeURIComponent(b));
5.        } else {
6.                window.open('https://translate.google.co.jp/translate?sl=en&tl=ja&js=n&prev=_t&hl=ja&ie=UTF-8&u=' + encodeURIComponent(location.href) + '&act=url');
7.        }
8.})();

🔻 Google日→英 のソースコード
1.javascript: (function() {
2.        var b = ((window.getSelection && window.getSelection()) || (document.getSelection && document.getSelection()) || (document.selection && document.selection.createRange && document.selection.createRange().text));
3.        if (b != '') {
4.                window.open('https://translate.google.co.jp/?hl=ja&tab=wT#ja/en/' + encodeURIComponent(b));
5.        } else {
6.                window.open('https://translate.google.co.jp/translate?sl=ja&tl=en&js=n&prev=_t&hl=ja&ie=UTF-8&u=' + encodeURIComponent(location.href) + '&act=url');
7.        }
8.})();




XCOPY で新しいファイルのみバックアップする為のスクリプトを作成するスクリプト / VBScript

⭕ ディレクトリ選択でバックアップするフォルダを決定 ⭕ カレント(このスクリプトを実行したフォルダ)にスクリプトが作成されます ⭕ 新しいスクリプトを実行 ⭕ カレントにバックアップ用のフォルダが作成されます ⭕ バックアップするフォルダ内をそのフォルダ内に全てコピーします ▼ 実行時に表示されるフォルダ選択 XCOPY なので、2回目以降は新しいファイルのみコピーします ▼ 作成されたスクリプトのサンプルです
01.strName = "BK_C_temp_lightbox"
02.strTarget = "C:\temp\lightbox"
03.strBackupFolder = "C:\tmp\vbs"
04.if MsgBox( strTarget & vbCrLf & "のバックアップを開始します。よろしいですか? (保存先:" & strBackupFolder & "\" & strName & ")", 1 ) = 2 then
05.        Wscript.Quit
06.end if
07.Set WshShell = Wscript.CreateObject( "WScript.Shell" )
08.ExecCommand = "cmd.exe /C ""xcopy.exe """ & strTarget & """ """ & strBackupFolder & "\" & strName & "\"" /D /E /C /S /Y & PAUSE"""
09.Call WshShell.Run( ExecCommand )

▼ 使用するオプション
/D : コピー元の日付がコピー先の日付より新しいファイルだけをコピーします
/E : ディレクトリまたはサブディレクトリが空であってもコピーします
/C : エラーが発生してもコピーを続けます
/S : 空の場合を除いて、ディレクトリとサブディレクトリをコピーします
/Y : 既存のファイルを上書きする前に確認のメッセージを表示しません

一番重要なのは、/D です。/S /E で、存在するディリクトリはすべてコピーされます。/E /Y によって、最後まで停止する事なく実行されます。

追加で使う事が想定されるオプション

コピーしたくないディレクトリやファイルがある場合、以下のように指定します。

/EXCLUDE:ファイルのパス

ファイルのパスが示すテキストファイル内に、除外するディレクトリやファイルにある文字列の一部を1 行に 1 つずつ記述します。

その文字列が、コピー対象ファイルの絶対パスの一部と一致した場合、そのファイルはコピーから除外されます。

▼ 例
⭕ "\obj\" という文字列を指定するとディレクトリ obj の下の全ファイルが除外 されます。
⭕ ".obj" という文字列を指定すると .obj という拡張子のファイルがすべて除外されます

ソースコード

001.' ***********************************************************
002.' 処理開始
003.' ***********************************************************
004.Set Fso = Wscript.CreateObject( "Scripting.FileSystemObject" )
005.Set Shell = Wscript.CreateObject( "Shell.Application" )
006. 
007.' ***********************************************************
008.' 実行中ディレクトリの取得
009.' ***********************************************************
010.strPath = Wscript.ScriptFullName
011.Set objFile = Fso.GetFile( strPath )
012.strBackupFolder = Fso.GetParentFolderName( objFile )
013. 
014.' ***********************************************************
015.' バックアップ対象ディレクトリの取得
016.' ***********************************************************
017.' ① 省略すると、ルートはデスクトップ
018.Set objFolder = Shell.BrowseForFolder( 0, "バックアップするフォルダを選択してください", &H4B )
019. 
020.' ② 文字列による直接指定
021.' strRoot = "c:\"
022.' Set objFolder = Shell.BrowseForFolder( 0, "バックアップするフォルダを選択してください", &H4B, strRoot )
023. 
024.' ③ ルートを番号で指定( この場合は C:\Users\username\AppData\Local )
025.' ※ あまり現実的ではない特殊ディレクトリの選択
026.' nRoot = &h1c
027.' Set objFolder = Shell.BrowseForFolder( 0, "バックアップするフォルダを選択してください", &H4B, nRoot )
028. 
029.if objFolder is nothing then
030.        WScript.Quit
031.end if
032.if not objFolder.Self.IsFileSystem then
033.        WScript.Echo "ファイルシステムではありません"
034.        WScript.Quit
035.end if
036. 
037.strTargetFolder = objFolder.Self.Path
038.strName = Replace( strTargetFolder, ":", "" )
039.strName = Replace( strName, "\", "_" )
040.strName = Replace( strName, " ", "" )
041.strName = "BK_" & strName
042. 
043.' ***********************************************************
044.' スクリプト作成
045.' ***********************************************************
046.Set OutFile = Fso.OpenTextFile( strBackupFolder & "\" & strName & ".vbs", 2, True )
047. 
048.OutFile.WriteLine "strName = """ & strName & """"
049.OutFile.WriteLine "strTarget = """ & strTargetFolder & """"
050.OutFile.WriteLine "strBackupFolder = """ & strBackupFolder & """"
051.OutFile.Write "if MsgBox( strTarget & vbCrLf & ""のバックアップを開始します。よろしいですか? (保存先:"" & strBackupFolder & ""\"" & strName & "")"""
052.OutFile.WriteLine ", 1 ) = 2 then"
053.OutFile.WriteLine "     Wscript.Quit"
054.OutFile.WriteLine "end if"
055. 
056.OutFile.WriteLine "Set WshShell = Wscript.CreateObject( ""WScript.Shell"" )"
057.OutFile.Write "ExecCommand = ""cmd.exe /C """"xcopy.exe """""" & strTarget & """""" """""" & strBackupFolder & ""\"" & strName & ""\"""""
058.OutFile.WriteLine " /D /E /C /S /Y & PAUSE"""""""
059.OutFile.WriteLine "Call WshShell.Run( ExecCommand )"
060. 
061.OutFile.Close
062. 
063.WScript.Echo "バックアップスクリプト : " &  strName & ".vbs" & " を作成しました"
064. 
065. 
066.' ***********************************************************
067.' ディレクトリ指定用番号
068.' https://docs.microsoft.com/ja-jp/windows/desktop/api/shldisp/ne-shldisp-shellspecialfolderconstants
069.' typedef enum {
070.'       ssfALTSTARTUP = 0x1d,
071.'       ssfAPPDATA = 0x1a,
072.'       ssfBITBUCKET = 0x0a,
073.'       ssfCOMMONALTSTARTUP = 0x1e,
074.'       ssfCOMMONAPPDATA = 0x23,
075.'       ssfCOMMONDESKTOPDIR = 0x19,
076.'       ssfCOMMONFAVORITES = 0x1f,
077.'       ssfCOMMONPROGRAMS = 0x17,
078.'       ssfCOMMONSTARTMENU = 0x16,
079.'       ssfCOMMONSTARTUP = 0x18,
080.'       ssfCONTROLS = 0x03,
081.'       ssfCOOKIES = 0x21,
082.'       ssfDESKTOP = 0x00,
083.'       ssfDESKTOPDIRECTORY = 0x10,
084.'       ssfDRIVES = 0x11,
085.'       ssfFAVORITES = 0x06,
086.'       ssfFONTS = 0x14,
087.'       ssfHISTORY = 0x22,
088.'       ssfINTERNETCACHE = 0x20,
089.'       ssfLOCALAPPDATA = 0x1c,
090.'       ssfMYPICTURES = 0x27,
091.'       ssfNETHOOD = 0x13,
092.'       ssfNETWORK = 0x12,
093.'       ssfPERSONAL = 0x05,
094.'       ssfPRINTERS = 0x04,
095.'       ssfPRINTHOOD = 0x1b,
096.'       ssfPROFILE = 0x28,
097.'       ssfPROGRAMFILES = 0x26,
098.'       ssfPROGRAMFILESx86 = 0x30,
099.'       ssfPROGRAMS = 0x02,
100.'       ssfRECENT = 0x08,
101.'       ssfSENDTO = 0x09,
102.'       ssfSTARTMENU = 0x0b,
103.'       ssfSTARTUP = 0x07,
104.'       ssfSYSTEM = 0x25,
105.'       ssfSYSTEMx86 = 0x29,
106.'       ssfTEMPLATES = 0x15,
107.'       ssfWINDOWS = 0x24
108.' } ShellSpecialFolderConstants;
109.' ***********************************************************

関連する Microsoft ドキュメント

Shell Reference
Shell Objects for Scripting and Microsoft Visual Basic
Shell object
Shell.BrowseForFolder method



Google Chrome のアドレス部分に書き込む簡易エディタ



以下をクリックして選択状態にして、Google Chrome のブックマークバーへドラッグすると、ブックマークレットとしていつでも実行できるようになります。( タイトルは編集で変更してください )

▲ このテキストを Google Chrome のアドレスへ書き込むだけで簡易的なテキストエディタになり、ローカルへ SHIFT_JIS で保存する事ができ、既存のテキスト( SHIFT_JIS と Unicode と UTF8:BOMあり )を読み込む事ができます。

▼ もちろん、通常のWEB ページ上で使用する事もできます


以下が【保存用】のテスト用ソースコードです。( 改行コードが CRLF になるように処理しています )
01.<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
02.<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js"></script>
03.<script src="https://winofsql.jp/js/encoding.js"></script>
04.<script src="https://winofsql.jp/js/save-sjis.js"></script>
05. 
06.<script>
07.$( function(){
08. 
09.        $("#save-action").on("click", function(){
10. 
11.                // テキストエリアのテキストを jQuery で取得            
12.                var text = $("#save-text").val();
13.                // lf のみを crlf に変換
14.                text = text.replace(/\n/g, '\r\n');
15.                // ローカルに保存する
16.                save_sjis( "save-sjis.txt", text );
17.        });
18. 
19.});
20.</script>
21.<div><input type="button" id="save-action" value="Save as Shift_JIS"></div>
22.<textarea id="save-text" style='width:400px;height:100px;'></textarea>

▼ save-sjis.js の内容です
01.var load_save_file_name = null;
02. 
03.var str2array = function(str) {
04. 
05.        var array = [],i,il=str.length;
06.        for(i=0;i<il;i++) array.push(str.charCodeAt(i));
07.        return array;
08. 
09.};
10. 
11.function save_sjis( filename, str ) {
12. 
13.        var array = str2array( str );
14.        var sjis_array = Encoding.convert(array, "SJIS", "UNICODE");
15.        var sjis_data = new Uint8Array(sjis_array);
16. 
17.        if ( load_save_file_name != null ) {
18.                filename = load_save_file_name;
19.        }
20. 
21.        saveAs(
22.                new Blob(
23.                        [sjis_data]
24.                        , {type: "text/plain;charset=shift_jis"}
25.                )
26.                , filename
27.        );
28. 
29.}
30. 
31.function load_sjis( event, target ) {
32. 
33.        var file = event.target.files[0];
34.        load_save_file_name = file.name;
35. 
36.        var reader = new FileReader();
37.        reader.onload = function(event) {
38.                target.value = event.target.result;
39.        };
40. 
41.        reader.readAsText(file,"shift_jis");
42. 
43.}

▼ 読込みのサンプルは以下のようになります
01.<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
02.<script src="https://winofsql.jp/js/save-sjis.js"></script>
03. 
04.<script>
05.$( function(){
06. 
07.        $("#get-text").on("change", function( event ){
08. 
09.                load_sjis( event, $("#save-text").get(0) );
10. 
11.        });
12. 
13.});
14.</script>
15.<div><input type="file" id="get-text"></div>
16.<textarea id="save-text" style='width:400px;height:100px;'></textarea>




「送る」に入れる簡易ダンプ ( VBScript )





※コマンドプロンプトの操作
Q : 終了します。
スペースキー : 次ページを表示します。
Enterキー : 次の行を表示します


自分で環境を作って、VBScript のコードファイルも自分で配置する場合は以下をご覧下さい。

SendTo フォルダにショートカットを作成する



この時、作業フォルダーを用意してそこに VBScript のコードファイルを保存します。実行するコマンドラインは以下のようになっています。

%windir%\system32\wscript.exe dump.vbs 35

35 は、コマンドプロンプトに一度に表示する行数です

dump.vbs( 作業フォルダーに置いてください )
01.if WScript.Arguments.Count = 1 then
02.        strMessage = "送るから実行して下さい" & vbCrLf & vbCrLf
03.        strMessage = strMessage & "※ リンク先の最後の数字はコマンドプロンプトの行数です   " & vbCrLf
04.        strMessage = strMessage & "※ プロパティよりウインドウを最大化する方法もあります   " & vbCrLf
05.        Call MsgBox(strMessage,0,"lightbox")
06.        Wscript.Quit
07.end if
08. 
09.Set WshShell = CreateObject( "WScript.Shell" )  
10.Set Fso = CreateObject( "Scripting.FileSystemObject" )
11. 
12.strCurPath = WScript.ScriptFullName
13.Set obj = Fso.GetFile( strCurPath )
14.Set obj = obj.ParentFolder
15.strCurPath = obj.Path
16. 
17.strCommand = "cmd /c mode CON lines="&WScript.Arguments(0)&" & cscript.exe """ & _
18.strCurPath & "\dump_c.vbs"" """ & WScript.Arguments(1) & """ | more & pause"
19.Call WshShell.Run( strCommand )

dump_c.vbs
001.' ****************************************************
002.' ファイルを16進数でダンプします
003.' ****************************************************
004.Dim Fs,Stream
005.Dim InFile
006.Dim Kana
007.Dim KjFlg
008.Kana = Array( _
009."。","「","」","、","・","ヲ","ァ","ィ","ゥ","ェ","ォ","ャ","ュ","ョ","ッ", _
010."ー","ア","イ","ウ","エ","オ","カ","キ","ク","ケ","コ","サ","シ","ス","セ","ソ", _
011."タ","チ","ツ","テ","ト","ナ","ニ","ヌ","ネ","ノ","ハ","ヒ","フ","ヘ","ホ","マ", _
012."ミ","ム","メ","モ","ヤ","ユ","ヨ","ラ","リ","ル","レ","ロ","ワ","ン","゙","゚" )
013. 
014.Set Fs = CreateObject( "Scripting.FileSystemObject" )
015.Set Stream = CreateObject("ADODB.Stream")
016. 
017.InFile = WScript.Arguments(0)
018. 
019.Dim LineBuffer,DispBuffer,CWork,nCnt,strBuff,i,j
020. 
021.if not Fs.FileExists( InFile ) then
022.        Wscript.Echo "ファイルが存在しません"
023.        Wscript.Quit
024.end if
025. 
026.' ------------------------------------------------------
027.' Stream のオープン
028.Stream.Open
029.  
030.' ------------------------------------------------------
031.' Stream タイプの指定
032.Stream.Type = 1         ' StreamTypeEnum の adTypeBinary
033.  
034.' ------------------------------------------------------
035.' 既存ファイルの内容を Stream に読み込む
036.Stream.LoadFromFile InFile
037.  
038.' ------------------------------------------------------
039.' バイナリ型の Stream オブジェクトからを読み取って加工
040.Bcnt = 0
041.nCnt = 0
042.KjFlg = ""
043. 
044.Do while not Stream.EOS
045. 
046.        if ( nCnt MOD 16 ) = 0 then
047.                Wscript.Echo "          0  1  2  3  4  5  6  7" _
048.                & "  8  9  A  B  C  D  E  F"
049.                Wscript.Echo "--------------------------------" _
050.                & "------------------------------------------"
051.        end if
052. 
053.        ' 16 バイトの読込
054.        LineBuffer = Stream.Read(16)
055. 
056.        strBuff = ""
057.        For i = 1 to LenB( LineBuffer )
058.                CWork = MidB(LineBuffer,i,1)
059.                Cwork = AscB(Cwork)
060.                Cwork = Hex(Cwork)
061.                Cwork = Ucase(Cwork)
062.                Cwork = Right( "0" & Cwork, 2 )
063.                DispBuffer = DispBuffer & Cwork & " "
064.                strBuff = strBuff & CharConv( Cwork )
065.        Next
066. 
067.        Wscript.Echo _
068.                Right( _
069.                        "00000000" & Ucase(Hex( nCnt * 16 )), 8 _
070.                ) & " " & _
071.                Left(DispBuffer & String(49," "), 49 ) & strBuff
072.        DispBuffer = ""
073. 
074.        nCnt = nCnt + 1
075.  
076.Loop
077.  
078.' ------------------------------------------------------
079.' Stream を閉じる
080.Stream.Close
081. 
082.Set Stream = Nothing
083.Stream = Empty
084.Set Fs = Nothing
085.Fs = Empty
086. 
087.' ****************************************************
088.' 生データのテキスト
089.' ****************************************************
090.function CharConv( HexCode )
091. 
092.        Dim nCode
093. 
094.        nCode = Cint( "&H" & HexCode )
095. 
096.        if KjFlg = "" then
097.                if &H81 <= nCode and nCode <= &H84 or _
098.                        &H88 <= nCode and nCode <= &H9f or _
099.                        &HE0 <= nCode and nCode <= &HEA then
100.                        KjFlg = HexCode
101.                        CharConv = ""
102.                        Exit Function
103.                end if
104.        else
105.                if HexCode <> "00" then
106.                        KjFlg = KjFlg & HexCode
107.                        CharConv = Chr( Cint( "&H" & KjFlg ) )
108.                else
109.                        CharConv = ".."
110.                end if
111.                KjFlg = ""
112.                Exit Function
113.        end if
114. 
115.        if 0 <= nCode and nCode <= &H1F then
116.                CharConv = "."
117.        end if
118.        if &H20 <= nCode and nCode <= &H7E then
119.                CharConv = Chr(nCode)
120.        end if
121.        if &H7F <= nCode and nCode <= &HA0 then
122.                CharConv = "."
123.        end if
124.        if &HA1 <= nCode and nCode <= &HDF then
125.                CharConv = Kana(nCode-&HA1)
126.        end if
127.        if &HE0 <= nCode and nCode <= &HFF then
128.                CharConv = "."
129.        end if
130. 
131.end function

ショートカットを直接実行すると、以下のようなダイアログが出ます



最大化は、dump.vbs の 17行目からを、画面の解像度に合わせてカラム数を以下のように設定して実行時のウインドウを選択すると実装できます( ただ、ダンプの表示幅が決まっているのでこの場合あまり意味ありません )

strCommand = "cmd /c mode CON cols=160 & cscript.exe """ & _
strCurPath & "\dump_c.vbs"" """ & WScript.Arguments(1) & """ | more & pause"
Call WshShell.Run( strCommand, 3 )

操作補足

エクスプローラで SendTo フォルダに移動するには、アドレスバーに sendto と直接入力します。





IE11のソースエディタの変更 / VBScript

最新の IE11 では、HKEY_CURRENT_USER でしか動作しないようです。





全て VBScript のみで実行しています。ですから、ファイル参照ウインドウの表示が、現在表示しているウインドウに隠れたりする場合があるので注意して下さい。

ieSrcEditor.wsf をエクスプローラから実行すると、ファイルを参照するダイアログが開きます。内部のコードは以下のようになっていますが、必要な関数等はインターネット上に保存して使用しています。ここでは、ローカルのファイルを開いてパスを取得する為に、InternetExplorer.Application を使用しています。

アンインストールは、zip 内の uninstall.reg か 以下のテキストを uninstall.reg として shift_jis か Unicode で保存してエクスプローラから実行します。内部は、Microsoft の仕様によるレジストリエントリの削除記述となっています。ですから、実際削除を行うのは、regedit.exe です。
1.Windows Registry Editor Version 5.00
2. 
3.[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\View Source Editor]

▼ 実行用のソースコードです
01.<JOB>
02.<COMMENT>
03.************************************************************
04. WEB WSH 実行スケルトン
05.************************************************************
06.</COMMENT>
07. 
08.<COMMENT>
09.************************************************************
10. 外部スクリプト定義
11.************************************************************
12.</COMMENT>
13.<SCRIPT
14.        language="VBScript"
15.        src="http://lightbox.in.coocan.jp/laylaClass.vbs">
16.</SCRIPT>
17. 
18.<SCRIPT language=VBScript>
19.' 管理者として実行を強制する
20.Set obj = Wscript.CreateObject("Shell.Application")
21.if Wscript.Arguments.Count = 0 then
22.        obj.ShellExecute "wscript.exe", WScript.ScriptFullName & " runas", "", "runas", 1
23.        Wscript.Quit
24.end if
25. 
26.' ***********************************************************
27.' 処理開始
28.' ***********************************************************
29.Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
30.Call laylaLoadFunction( "baseFunction.vbs" )
31.Call laylaLoadFunction( "wmiReg.vbs" )
32.Call laylaLoadFunction( "toolFunction.vbs" )
33. 
34.' **********************************************************
35.' エディタ選択
36.' **********************************************************
37.strValue = OpenLocalFileName
38.if strValue = "" then
39.        Wscript.Quit
40.end if
41. 
42.' **********************************************************
43.' レジストリ
44.' **********************************************************
45.strPath = "SOFTWARE\Microsoft\Internet Explorer\View Source Editor\Editor Name"
46.Call WMIRegCreateKey( HKEY_CURRENT_USER, strPath )
47.strValue = Dd( strValue )
48.Call WMIRegSetStringValue( HKEY_CURRENT_USER, strPath, Empty, strValue )
49. 
50.MsgOk( strValue & " を IE のソースエディタとして登録しました" )
51. 
52.Function OpenLocalFileName( )
53. 
54.        Call GetObj( "IEDocument", "InternetExplorer.Application" )
55.        IEDocument.Navigate( ScriptDir( ) & "\local.htm" )
56.        IEDocument.document.getElementsByTagName("BODY")(0).innerHTML = "<input id=FilePath type=file>"
57.        IEDocument.document.getElementById("FilePath").click
58.        if IEDocument.document.getElementById("FilePath").value = "" then
59.                OpenLocalFileName = ""
60.                IEDocument.Quit
61.                Set IEDocument = Nothing
62.                Exit Function
63.        end if
64. 
65.        OpenLocalFileName = IEDocument.document.getElementById("FilePath").value
66. 
67.        IEDocument.Quit
68.        Set IEDocument = Nothing
69. 
70.End Function
71.</SCRIPT>
72.</JOB>




コンピュータアイコンにメニューを追加する

※ Windows の大きなアップデートで消える可能性はありますが、自分の好きなコマンドでカスタマイズできるので便利です。

▼ Windows10


▼ インストールするレジストリのキー
HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell

現状ではおそらくレジストリの該当場所の所有者が TrustedInstaller となっており、Administrators グループに権限が無いと思います。

いったん所有者を Administrators グループ に変更してから、Administrators グループ にアクセス権限を与えます。その後にレジストリのインポートを行って下さい。


アクセス許可を選択して表示されたダイアログの詳細設定ボタンをクリックして、表示された『shell のセキュリティの詳細設定』というダイアログの先頭にある『変更リンク』で所有者を変更します。

Administrators に変更した後、アクセス許可で Administrators にフルコントロールを設定します。


▼ 解凍後の内容

▼ README

************************************************************
コンピュータアイコンメニュー設定レジストリデータ

■ 事前準備

	インストール場所を開く.bat をエクスプローラからダブル
	クリックしてレジストリエディタを起動し、選択されている
	キーの所有者を自分が所属する Administrators グループに
	変更して、Administrators にフルコントロールを設定します

■ インストール

	computer_menu をエクスプローラからタブルクリック
	してインポートして下さい

■ アンインストール

	uninstall_computer_menu をエクスプローラからタブル
	クリックして下さい


■ 登録された場所でレジストリエディタを開く
	インストール場所を開く.bat をエクスプローラからタブ
	ルクリックして下さい

■著作権その他

このプログラムはフリーです。どうぞ自由に御使用ください。
著作権は作者である私(lightbox)が保有しています。
また、本ソフトを運用した結果については、作者は一切責任を
負えせんのでご了承ください。
************************************************************

computer_menu.reg

001 : mmc.exe "%SystemRoot%\system32\services.msc" /s
002 : "%ProgramFiles%\Common Files\Microsoft Shared\MSInfo\msinfo32.exe"
003 : RunDLL32.EXE shell32.dll,Control_RunDLL appwiz.cpl
004 : RunDLL32.EXE shell32.dll,Control_RunDLL odbccp32.cpl
005 : regedit.exe
006 : %SystemRoot%\system32\cmd.exe
007 : UserAccountControlSettings.exe
008 : mmc.exe "%windir%\system32\eventvwr.msc" /s
009 : rundll32.exe netplwiz.dll,UsersRunDll
010 : rundll32.exe sysdm.cpl,EditEnvironmentVariables
011 : cmd.exe /c powershell -NoProfile -ExecutionPolicy unrestricted -WindowStyle hidden -Command "start notepad.exe %SystemRoot%\system32\drivers\etc\hosts -verb runas"
012 : RUNDLL32.EXE shell32.dll,Options_RunDLL 7
013 : mmc.exe "%windir%\system32\taskschd.msc" /s
014 : mmc.exe "%SystemRoot%\system32\gpedit.msc"
015 : mstsc.exe
016 : control.exe /name Microsoft.WindowsUpdate
001.Windows Registry Editor Version 5.00
002. 
003.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\001]
004.@="   サービス"
005. 
006.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\001\command]
007.@=hex(2):6d,00,6d,00,63,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,53,00,79,\
008.  00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,\
009.  73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,65,00,72,00,76,00,69,00,63,\
010.  00,65,00,73,00,2e,00,6d,00,73,00,63,00,22,00,20,00,2f,00,73,00,00,00
011. 
012.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\002]
013.@="   システム情報"
014. 
015.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\002\command]
016.@=hex(2):22,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,\
017.  00,65,00,73,00,25,00,5c,00,43,00,6f,00,6d,00,6d,00,6f,00,6e,00,20,00,46,00,\
018.  69,00,6c,00,65,00,73,00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,\
019.  00,74,00,20,00,53,00,68,00,61,00,72,00,65,00,64,00,5c,00,4d,00,53,00,49,00,\
020.  6e,00,66,00,6f,00,5c,00,6d,00,73,00,69,00,6e,00,66,00,6f,00,33,00,32,00,2e,\
021.  00,65,00,78,00,65,00,22,00,00,00
022. 
023.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\003]
024.@="   プログラムと機能"
025. 
026.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\003\command]
027.@="RunDLL32.EXE shell32.dll,Control_RunDLL appwiz.cpl"
028. 
029.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\004]
030.@="   ODBC アドミニストレータ"
031. 
032.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\004\command]
033.@="RunDLL32.EXE shell32.dll,Control_RunDLL odbccp32.cpl"
034. 
035.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\005]
036.@="   レジストリエディタ"
037. 
038.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\005\command]
039.@="regedit.exe"
040. 
041.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\006]
042.@="   コマンドプロンプト"
043. 
044.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\006\command]
045.@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
046.  00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,63,00,6d,00,\
047.  64,00,2e,00,65,00,78,00,65,00,00,00
048. 
049.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\007]
050.@="   UAC"
051. 
052.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\007\command]
053.@=hex(2):55,00,73,00,65,00,72,00,41,00,63,00,63,00,6f,00,75,00,6e,00,74,00,43,\
054.  00,6f,00,6e,00,74,00,72,00,6f,00,6c,00,53,00,65,00,74,00,74,00,69,00,6e,00,\
055.  67,00,73,00,2e,00,65,00,78,00,65,00,00,00
056. 
057.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\008]
058.@="   イベント ビューアー"
059. 
060.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\008\command]
061.@=hex(2):6d,00,6d,00,63,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,77,00,69,\
062.  00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,\
063.  33,00,32,00,5c,00,65,00,76,00,65,00,6e,00,74,00,76,00,77,00,72,00,2e,00,6d,\
064.  00,73,00,63,00,22,00,20,00,2f,00,73,00,00,00
065. 
066.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\009]
067.@="   ユーザーアカウント"
068. 
069.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\009\command]
070.@="rundll32.exe netplwiz.dll,UsersRunDll"
071. 
072.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\010]
073.@="   環境変数"
074. 
075.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\010\command]
076.@="rundll32.exe sysdm.cpl,EditEnvironmentVariables"
077. 
078.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\011]
079.@="   HOSTS"
080. 
081.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\011\command]
082.@=hex(2):63,00,6d,00,64,00,2e,00,65,00,78,00,65,00,20,00,2f,00,63,00,20,00,70,\
083.  00,6f,00,77,00,65,00,72,00,73,00,68,00,65,00,6c,00,6c,00,20,00,2d,00,4e,00,\
084.  6f,00,50,00,72,00,6f,00,66,00,69,00,6c,00,65,00,20,00,2d,00,45,00,78,00,65,\
085.  00,63,00,75,00,74,00,69,00,6f,00,6e,00,50,00,6f,00,6c,00,69,00,63,00,79,00,\
086.  20,00,75,00,6e,00,72,00,65,00,73,00,74,00,72,00,69,00,63,00,74,00,65,00,64,\
087.  00,20,00,2d,00,57,00,69,00,6e,00,64,00,6f,00,77,00,53,00,74,00,79,00,6c,00,\
088.  65,00,20,00,68,00,69,00,64,00,64,00,65,00,6e,00,20,00,2d,00,43,00,6f,00,6d,\
089.  00,6d,00,61,00,6e,00,64,00,20,00,22,00,73,00,74,00,61,00,72,00,74,00,20,00,\
090.  6e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,20,00,25,\
091.  00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,5c,00,\
092.  73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,72,00,69,00,76,\
093.  00,65,00,72,00,73,00,5c,00,65,00,74,00,63,00,5c,00,68,00,6f,00,73,00,74,00,\
094.  73,00,20,00,2d,00,76,00,65,00,72,00,62,00,20,00,72,00,75,00,6e,00,61,00,73,\
095.  00,22,00,00,00
096. 
097.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\012]
098.@="   フォルダオプション"
099. 
100.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\012\command]
101.@="RUNDLL32.EXE shell32.dll,Options_RunDLL 7"
102. 
103.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\013]
104.@="   タスク スケジューラ"
105. 
106.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\013\command]
107.@=hex(2):6d,00,6d,00,63,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,77,00,69,\
108.  00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,\
109.  33,00,32,00,5c,00,74,00,61,00,73,00,6b,00,73,00,63,00,68,00,64,00,2e,00,6d,\
110.  00,73,00,63,00,22,00,20,00,2f,00,73,00,00,00
111. 
112.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\014]
113.@="   ローカル グループ ポリシーエディタ"
114. 
115.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\014\command]
116.@=hex(2):6d,00,6d,00,63,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,53,00,79,\
117.  00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,\
118.  73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,67,00,70,00,65,00,64,00,69,00,74,\
119.  00,2e,00,6d,00,73,00,63,00,22,00,00,00
120. 
121.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\015]
122.@="   リモートデスクトップ"
123. 
124.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\015\command]
125.@="mstsc.exe"
126. 
127.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\016]
128.@="   Windows Update"
129. 
130.[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\016\command]
131.@="control.exe /name Microsoft.WindowsUpdate"

▼ インストール場所


▼ インストール場所を レジストリエディタで開く VBScript
01.strParam = Trim( "HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell" )
02.' 無ければ、クリップボード
03.if strParam = "" then
04.        ' クリップボード用
05.        ' ※ HTA 等では直接 window.clipboardData より実行
06.        ' ※ するように書き換える必要があります
07.        Set objIE = CreateObject("InternetExplorer.Application")
08.        objIE.Navigate("about:blank")
09.        Do While objIE.Busy
10.                ' 100 ミリ秒
11.                Wscript.Sleep 100
12.        Loop
13.        strParam = objIE.document.parentWindow.clipboardData.GetData( "Text" ) & ""
14.        objIE.Quit
15.end if
16.strParam = Trim( strParam )
17.' 無ければ入力
18.if strParam = "" then
19.        strParam = InputBox("開く対象となるレジストリーのキーを入力して下さい")
20.end if
21.if strParam = "" then
22.        Wscript.Quit
23.end if
24. 
25.' レジストリ書き込み用
26.Set WshShell = CreateObject( "WScript.Shell" )
27.' WMI用
28.Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
29. 
30.' レジストリエディタが最後に開いていたキーの登録を行います
31.strPath = "Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey"
32.if GetOSVersion() >= 6 then
33.        strRegPath = "コンピューター\" & strParam
34.else
35.        strRegPath = "マイ コンピュータ\" & strParam
36.end if
37. 
38.' 既に regedit が実行中の場合はいったん終了させます
39.Set colProcessList = objWMIService.ExecQuery _
40.        ("Select * from Win32_Process Where Name = 'regedit.exe'")
41.For Each objProcess in colProcessList
42.        ' 最後のウインドウの位置とサイズを保存する為の終わらせ方
43.        WshShell.AppActivate("レジストリ エディタ")
44.        Wscript.Sleep(500)
45.        WshShell.SendKeys ("%{F4}")
46.        Wscript.Sleep(500)
47.        ' 上記終わらせ方が失敗した時の強制終了
48.        on error resume next
49.        objProcess.Terminate()
50.        on error goto 0
51.Next
52. 
53.WshShell.RegWrite "HKCU\" & strPath, strRegPath, "REG_SZ"
54. 
55.' レジストリエディタを起動します
56.Call WshShell.Run( "regedit.exe" )
57.' レジストリエディタが終わるまで待つ場合は以下のようにします
58.' Call WshShell.Run( "regedit.exe", , True )
59. 
60.REM **********************************************************
61.REM OS バージョンの取得
62.REM **********************************************************
63.Function GetOSVersion()
64. 
65.        Dim colTarget,str,aData,I,nTarget
66. 
67.        Set colTarget = objWMIService.ExecQuery( _
68.                 "select Version from Win32_OperatingSystem" _
69.        )
70.        For Each objRow in colTarget
71.                str = objRow.Version
72.        Next
73. 
74.        aData = Split( str, "." )
75.        For I = 0 to Ubound( aData )
76.                if I > 1 then
77.                        Exit For
78.                end if
79.                if I > 0 then
80.                        nTarget = nTarget & "."
81.                end if
82.                nTarget = nTarget & aData(I)
83.        Next
84. 
85.        GetOSVersion = CDbl( nTarget )
86. 
87.End Function