How to create ls in windows command prompt? How to create ls in windows command prompt? windows windows

How to create ls in windows command prompt?


You can solve this question with one simple command:

echo @dir %* > %systemroot%\system32\ls.bat

Make sure you run cmd.exe as admin first if you are on vista and up


You could:

  • create a batch file called ls.bat and have it contain the dir command only
  • add the directory where the ls.bat file exists to your PATH environment variable

You could then execute ls from a command prompt.


Its an old question but for the record:

http://gnuwin32.sourceforge.net/packages/coreutils.htm

Gives you ls and a whole lot more!