「コマンドプロンプトを開く」の版間の差分

MSY-07 (トーク | 投稿記録)
ソースコードの整形
MSY-07 (トーク | 投稿記録)
SyntaxHighlightにcopyの追加
 
(同じ利用者による、間の1版が非表示)
5行目: 5行目:
([[フォルダを開く]]マクロのコピペです)
([[フォルダを開く]]マクロのコピペです)


<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript" copy>
// コマンドプロンプトを開く.js
// コマンドプロンプトを開く.js


var shell = new ActiveXObject("WScript.Shell")
var shell = new ActiveXObject("WScript.Shell");
var path = document.Path
var path = document.Path;


if (path == "") {
if (path == "") {
path = shell.SpecialFolders("Desktop")
path = shell.SpecialFolders("Desktop");
}
}


shell.CurrentDirectory = path
shell.CurrentDirectory = path;
shell.Run("cmd")
shell.Run("cmd");
</syntaxhighlight>
</syntaxhighlight>
スポンサーリンク