Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue in passing argument to custom protocol through href?

I have created a custom protocol by name "myapp" and trying to pass arguments to it via href tag as <a href="myapp://E:/file.txt">Click here</a>.

myapp protocol is as described below:

[HKEY_CLASSES_ROOT\myapp]
@="\"URL:Alert Protocol\""
"URL Protocol"="\"\""

[HKEY_CLASSES_ROOT\myapp\DefaultIcon]
@="\"C:\\WINDOWS\\System32\\notepad.exe,1\""

[HKEY_CLASSES_ROOT\myapp\shell]

[HKEY_CLASSES_ROOT\myapp\shell\open]

[HKEY_CLASSES_ROOT\myapp\shell\open\command]
@="\"C:\\WINDOWS\\System32\\notepad.exe\" \"%1\""

On clicking the anchor link it throws an error as "The filename, directory name, or volume label syntax is incorrect."

I guess the argument passed through <a href="myapp:E:/file.txt"> tag is not getting recognized.

I have no idea how to escape the slashes(/) or any special character here.

Please,help me with this or let me know if I am doing i wrong.

like image 627
Rahmath Unissa Avatar asked Nov 20 '25 09:11

Rahmath Unissa


1 Answers

The problem is that your command line has become

C:\WINDOWS\system32\notepad.exe myapp:E:/file.txt

I'm sure you were expecting it to be

C:\WINDOWS\system32\notepad.exe E:/file.txt

like image 148
xinu-john Avatar answered Nov 22 '25 04:11

xinu-john



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!