「コマンドプロンプトを開く」の版間の差分
<source>タグを<syntaxhighlight>タグに置き換える |
SyntaxHighlightにcopyの追加 |
||
| (同じ利用者による、間の2版が非表示) | |||
| 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"); | ||
} | } | ||
shell.CurrentDirectory = path | shell.CurrentDirectory = path; | ||
shell.Run("cmd") | shell.Run("cmd"); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
スポンサーリンク