How to create ls in windows command prompt?

前端 未结 19 2310
一向
一向 2020-12-07 08:34

I want to use ls in windows command prompt and make it run the dir command.

How can I do that?

19条回答
  •  臣服心动
    2020-12-07 09:04

    You could follow this guide: https://gist.github.com/vladikoff/38307908088d58af206b

    TL;DR: pass /K path/to/custom/init_cmd.bat to your "shell startup" command.

    I'm using ConsoleZ as my shell wrapper, so in my case I can find the setup option in "tabs", then I set the shell path to "C:\Windows\System32\cmd.exe "/K C:\cmd_init.bat"" like this.

    Where C:\cmd_init.bat is the batch script containing my macros, here's what I would go for:

    @echo off
    
    doskey ls=dir /b
    rem other macro stuff..
    

    Sorry for formatting and other mistakes, this is my first time answering here. I hope it helps!

提交回复
热议问题