Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems with HKEY_CLASSES_ROOT\Directory\Background\shell

I am try to send the name of a/any directory in Windows Explorer's Left column using the context menu to a program I wrote in Raku.

I have written the following to the registry

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWithFileAttributes.pl6\command]
@="\"C:\\rakudo\\bin\\raku.exe\" \"K:\\Windows\\NtUtil\\FileAttributes.pl6\" \"%V\""

Copied from the key itself it looks like:

"C:\rakudo\bin\raku.exe" "K:\Windows\NtUtil\FileAttributes.pl6" "%V"

When I right click on a directory in the left column, and left click on FileAttributes.pl6, it starts Raku in a shell, but does nothing else. It does not start FileAttrebes.pl6 (or -v or -V or -?).

How do I tell the registry to send the parameters to Raku?

Many thanks, -T

p.s. I already have folders and files from the right pane working

like image 955
Todd Avatar asked Mar 28 '26 04:03

Todd


1 Answers

I tested this on Windows 10, Rakudo version 2020.01.

First I created a test script C:\Users\hakon\raku\test.raku:

use v6;
say "Hello world!";
say "Arguments:";
say "'$_'" for @*ARGS;
sleep 5;

Then I opened regedit.exe and added the key:

Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWithRaku\command

I set the value of the latter command key to

C:\rakudo\bin\raku.exe C:\Users\hakon\raku\test.raku 1 2 3 "%V"

enter image description here


Then, I opened a new File Explorer window, and selected a folder from the left pane, and then right clicked on an empty space under the directory listing in the right pane, I then chose "OpenWithRaku" from the context menu.

enter image description here


After that a terminal window opened with the following output:

Hello world!
Arguments:
'1'
'2'
'3'
'C:\Users\hakon\raku'

So it seems to work fine on my machine.

like image 188
Håkon Hægland Avatar answered Mar 29 '26 22:03

Håkon Hægland



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!