在microtik Winbox的注册表编辑器中添加自定义协议

Adding Custom Protocol in Registry Editor for MikroTik Winbox

本文关键字:添加 自定义 协议 编辑器 注册表 microtik Winbox      更新时间:2023-10-16

我有一个叫做Winbox的小windows应用程序(它是一个用来控制RouterBoard的小应用程序)。我们正在制作一个web应用程序,它需要制作一个自定义协议URL,如:

oxo://192.168.103.3 {USERNAME} {PASSWORD}

我只需要oxo://指向[c:/winbox.exe]并使用参数{IP ADDRESS} {USERNAME} {PASSWORD}执行应用程序

所以我编辑了一个注册表编辑器代码:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOToxo]
@=""URL:oxo Protocol""
"EditFlags"=hex:02,00,00,00
"URL Protocol"=""
[HKEY_CLASSES_ROOToxoDefaultIcon]
@=""C:\winbox.exe",0"
[HKEY_CLASSES_ROOToxoshell]
[HKEY_CLASSES_ROOToxoshellopen]
[HKEY_CLASSES_ROOToxoshellopencommand]
@=""C:\winbox.exe" "%1""

但是问题是当在浏览器中打开url时,它会在{IP ADDRESS}字段中显示"oxo://{IP ADDRESS}"。

我所需要的就是从最终的可执行路径

中删除协议名称"oxo://"的第一部分。

如果想下载Winbox.exe:http://download2.mikrotik.com/winbox.exe

用法:

winbox.exe {IP ADDRESS} {USERNAME} {PASSWORD}

{IP ADDRESS} : Is the IP Address of the remote RouterBaord device.
{USERNAME} : Is the username of the RouterBoard Device.
{PASSWORD} : Is the password of the RouterBoard Device.

请我需要任何帮助与这个问题,即使它是在JAVA, C, c++或任何编程语言。

我只是想从web浏览器运行带有参数的exe文件。

很多谢谢,Areeb

你的链接包含动态参数,关键是要使oxo是打开控制台应用程序您可以在控制台应用程序中使用此代码将应用程序重定向到winbox.exe

 Sub Main()
        On Error Resume Next
        Dim url As String = Command()
        url = url.Replace("/", "")
        url = url.Replace("oxo", "")
        url = url.Replace(":", "")
        Dim arg() As String = url.Split(",")
        Dim IP As String = arg(2)
        Dim Username As String = arg(1)
        Dim Password As String = arg(0)
        Shell("c:winboxwinbox.exe " & IP & " " & Username & " " & Password)
        Console.WriteLine("Yout username : " & Username & " Password : " & Password & " Ip : " & IP)
    End Sub

和你的链接将是

oxo://{PASSWORD},{USERNAME},{IP}