You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无需批处理:通过注册表配置特定扩展名文件用默认浏览器打开带路径本地URL

Direct Registry Configuration for .mylog Files (No Batch File Required)

Got it, let's cut out that batch file middleman and set up your .mylog files to open directly in the browser with the file path in the URL. Here's exactly how to do it step by step:

  • Step 1: Link .mylog to a custom file type
    Open the Registry Editor by typing regedit.exe in the Start Menu or Run dialog. Navigate to HKEY_CLASSES_ROOT\.mylog.
    Set the default value (right-click → Modify) to a unique identifier like MyLogFileHandler—this is just a name to tie the file extension to our custom command.

  • Step 2: Create the "Open" command structure
    Now we need to build the command that runs when you double-click a .mylog file. Navigate to HKEY_CLASSES_ROOT\MyLogFileHandler (create this key if it doesn't exist: right-click HKEY_CLASSES_ROOT → New → Key, name it MyLogFileHandler).
    Under that, create these subkeys in order:

    1. Right-click MyLogFileHandler → New → Key, name it shell
    2. Right-click shell → New → Key, name it open
    3. Right-click open → New → Key, name it command
  • Step 3: Set the command to launch the browser
    Select the command key, then double-click the default value in the right pane. Paste this command:

    cmd /c start "" "http://localhost:3210/?myFile=%1"
    

    Let's break this down:

    • cmd /c: Runs the following command and then closes the command prompt window automatically.
    • start "": The empty quotes are critical here—they act as the window title for the start command, which prevents errors when the file path contains spaces.
    • %1: This placeholder gets replaced with the full path of the .mylog file (including quotes if the path has spaces) when you double-click it.
  • Step 4: Test it out
    Close the Registry Editor, then double-click any .mylog file. Your default browser should open straight to http://localhost:3210/?myFile=C:\your\file\path.mylog—no batch file involved!

Optional: Use a specific browser instead of default

If you want to force a particular browser (like Chrome or Edge) instead of the system default, replace the command with the full path to the browser executable. For example, for Chrome:

"C:\Program Files\Google\Chrome\Application\chrome.exe" "http://localhost:3210/?myFile=%1"

Quick Note

Always back up your registry before making changes (File → Export in Registry Editor) just to be safe—though these steps are straightforward and low-risk when done correctly.

内容的提问来源于stack exchange,提问作者Amir

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:21:18