Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the `run` command working on Windows 11?

Tags:

windows

raku

I wanted to try testing Raku code on Windows. I managed to get Windows 11 set up on VirtualBox and the Raku binary installed and I can execute scripts.

However, I cannot seem to get the simplest run command to do anything without returning an error:

run('ls');

results in:

The spawned command 'ls' exited unsuccessfully (exit code: 1, signal: 0)
  in block <unit> at .\test.txt line 5

I also tried with dir command, but had the same problem.

like image 335
StevieD Avatar asked Oct 14 '25 08:10

StevieD


1 Answers

There is no ls program on Windows by default, and dir is not an executable that can be run, but rather a Windows command shell built-in. You could try using shell instead of run, or instead try something like:

run 'cmd.exe', '/c', 'dir'

like image 96
Jonathan Worthington Avatar answered Oct 17 '25 13:10

Jonathan Worthington