[Actionscript3] 纯文本查看 复制代码
;读取脚本当前运行目录
Dim $runScript = @ScriptDir
;拼接VSCode的运行文件
Dim $runScriptExePath = $runScript & "\Code.exe"
; 查找文件是否存在
If FileExists($runScriptExePath) = 0 Then
MsgBox(0 + 16, "文件不存在->消逝的过去制作", "请移动到VSCode目录下运行该脚本!")
Exit
EndIf
;插入注册表
RegWrite("HKEY_CLASSES_ROOT\*\shell\VSCode", "", "REG_SZ", "Open with Code")
RegWrite("HKEY_CLASSES_ROOT\*\shell\VSCode", "Icon", "REG_SZ", $runScriptExePath)
RegWrite("HKEY_CLASSES_ROOT\*\shell\VSCode\command", "", "REG_SZ", $runScriptExePath & " %1")
RegWrite("HKEY_CLASSES_ROOT\Directory\shell\VSCode", "", "REG_SZ", "Open with Code")
RegWrite("HKEY_CLASSES_ROOT\Directory\shell\VSCode", "Icon", "REG_SZ", $runScriptExePath)
RegWrite("HKEY_CLASSES_ROOT\Directory\shell\VSCode\command", "", "REG_SZ", $runScriptExePath & " %V")
RegWrite("HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode", "", "REG_SZ", "Open with Code")
RegWrite("HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode", "Icon", "REG_SZ", $runScriptExePath)
RegWrite("HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command", "", "REG_SZ", $runScriptExePath & " %V")
MsgBox(0, "操作完成->消逝的过去制作", "右键菜单已添加!")