Name Date Size #Lines LOC

..08-May-2022-

lang/H02-Aug-2024-12,18312,118

res/H08-May-2022-

CMakeLists.txtH A D02-Aug-20241.2 KiB7369

alias.cH A D08-May-20224.5 KiB214144

assoc.cH A D02-Aug-20247.1 KiB313237

batch.cH A D02-Aug-202415.3 KiB594339

batch.hH A D08-May-20222.2 KiB8553

beep.cH A D08-May-2022922 5017

call.cH A D02-Aug-20245.7 KiB218122

choice.cH A D08-May-20226.8 KiB312218

cls.cH A D08-May-2022834 4613

cmd.cH A D02-Aug-202467.8 KiB2,4491,691

cmd.hH A D02-Aug-202411.3 KiB519317

cmd.rcH A D27-Jun-20232.2 KiB10193

cmddbg.cH A D08-May-20225.4 KiB248207

cmddbg.hH A D08-May-2022950 3726

cmdinput.cH A D02-Aug-202425.8 KiB742517

cmdtable.cH A D02-Aug-20244.6 KiB261175

cmdver.hH A D08-May-202262 32

color.cH A D08-May-20222.5 KiB10654

config.hH A D02-Aug-20242.1 KiB8951

console.cH A D27-Sep-20248.2 KiB369245

console.hH A D17-Nov-20232.4 KiB10759

copy.cH A D27-Sep-202225.6 KiB886644

ctty.cH A D02-Aug-202410.3 KiB342207

date.cH A D02-Aug-20245.5 KiB258180

del.cH A D08-May-202216.8 KiB552395

delay.cH A D08-May-2022691 4927

dir.cH A D17-Jul-202367.5 KiB1,9991,339

dirstack.cH A D08-May-20222.8 KiB184112

echo.cH A D08-May-20222.7 KiB13686

error.cH A D27-Sep-20243.3 KiB173111

filecomp.cH A D08-May-202221.2 KiB800570

files.txtH A D08-May-20222.4 KiB5957

for.cH A D08-May-202219.8 KiB669487

free.cH A D08-May-20222.7 KiB12183

goto.cH A D08-May-20225 KiB19796

history.cH A D08-May-20227.1 KiB381258

history.txtH A D08-May-202212.8 KiB368309

if.cH A D08-May-20225.4 KiB212144

internal.cH A D08-May-202217.7 KiB714380

license.txtH A D08-May-202217.7 KiB340281

locale.cH A D02-Aug-20242.2 KiB8051

memory.cH A D08-May-20222.1 KiB7551

misc.cH A D02-Aug-202416.5 KiB699497

mklink.cH A D08-May-20227.5 KiB225187

move.cH A D08-May-202218.3 KiB523402

msgbox.cH A D08-May-20222.9 KiB15497

parser.cH A D08-May-202257.5 KiB2,1081,465

path.cH A D08-May-20222.6 KiB11869

pause.cH A D08-May-20221.1 KiB6119

precomp.hH A D02-Aug-20241.5 KiB7152

prompt.cH A D10-May-20247.4 KiB301177

readme.txtH A D08-May-20222 KiB5441

readme2.txtH A D08-May-20223.5 KiB5040

redir.cH A D08-May-20224.7 KiB165113

ren.cH A D17-Nov-20239.7 KiB341242

ren.txtH A D08-May-20223.8 KiB9258

resource.hH A D02-Aug-20246.5 KiB235187

screen.cH A D08-May-20221.7 KiB10365

set.cH A D27-Oct-202417 KiB755558

setlocal.cH A D08-May-20224.3 KiB171122

shift.cH A D08-May-20221.6 KiB8539

start.cH A D17-Nov-202310.1 KiB346289

strtoclr.cH A D08-May-20225.2 KiB274156

time.cH A D17-Nov-20234.1 KiB214140

timer.cH A D08-May-20224.7 KiB219148

title.cH A D08-May-2022696 3916

todo.txtH A D08-May-2022781 1410

trace.cH A D02-Aug-20242.2 KiB7352

type.cH A D17-Nov-202310 KiB368263

ver.cH A D10-May-20245.4 KiB202127

verify.cH A D08-May-2022876 4818

vol.cH A D08-May-20222.1 KiB11573

wcwidth.cH A D17-Jul-202313.8 KiB314180

where.cH A D08-May-20226.6 KiB239131

window.cH A D17-Nov-20234.7 KiB226158

readme.txt

1ReactOS command line interpreter CMD
2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3
4The ReactOS command line interpreter CMD is derived from FreeCOM, the
5FreeDOS command line interpreter.
6
7We are shooting mainly to be just like 2000/XP cmd.exe.  They are very close and only a small number(none that i can recall off the top of my head, so maybe 0) differences have been found between those two.  It has been reported that ROS cmd.exe does not work on nt4 because of a missing api.  I'm hoping to fix this at some point.
8
9
10Compiling
11~~~~~~~~~
12ROS cmd used to depend on __REACTOS__ to provide two different ways to build cmd.  There is still code left in it for this but...  The __REACTOS__ = 0 has not been develped, maintained.  And therefore it does not even compile anymore.  __REACTOS__ = 1 works fine on both windows(nt). and someday i plan to remove all the __REACTOS__ = 0.
13
14Using rbuild you can compile cmd separately by "make cmd_install".  Also you can compile cmd using MSVC 6 and soon 7/8 hopefully.
15
16
17Current Features
18~~~~~~~~~~~~~~~~
19 - environment handling with prompt and path support.
20 - directory utilities.
21 - command-line history with doskey-like features.
22 - batch file processing.
23 - input/output redirection and piping.
24 - alias support.
25 - filename completion (use TAB), both Bash and Windows-CMD style.
26
27
28Credits
29~~~~~~~
30FreeDOS developers:
31   normat@rpi.edu (Tim Norman)
32   mrains@apanix.apana.org.au (Matt Rains)
33   ejeffrey@iastate.edu (Evan Jeffrey)
34   Steffen.Kaiser@Informatik.TU-Chemnitz.DE (Steffen Kaiser)
35   Svante Frey (sfrey@kuai.se)
36   Oliver Mueller (ogmueller@t-online.de)
37   Aaron Kaufman (morgan@remarque.berkeley.edu)
38   Marc Desrochers (bitzero@hotmail.com)
39   Rob Lake (rlake@cs.mun.ca)
40   John P. Price <linux-guru@gcfl.net>
41   Hans B Pufal <hansp@digiweb.com>
42
43ReactOS developers:
44   Eric Kohl
45   Emanuele Aliberti <ea@iol.it>
46   Paolo Pantaleo <paolopan@freemail.it>
47   Brandon Turner <turnerb7@msu.edu>
48
49
50Bugs
51~~~~
52There are still many bugs ;)
53Please report bugs to ReactOS team <ros-dev@reactos.org> or to JIRA at www.reactos.org
54

readme2.txt

1General Overview of How Things Work
2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3First it comes into _main in cmd.c(1811).  The command line params are taking in and if it is unicode it uses CommandLineToArgvW.
4This can cause a problem on older machines and that is why we have our own custom _CommandLineToArgvW to help this along.
5We pull in the launch directory as the initial dir and set that in _tchdir.  We make a handle to the default console out using CreateFile.
6
7Then we call Initialize().  Here we need to load ntdll.dll if it isn't loaded (windows 9x machines).
8We also setup some global vars like default io handles and nErrorLevel and set %prompt% to $P$G.
9This is where all command lines switches given to cmd on startup are done.
10
11From here main calls ProcessInput().  This is where cmd loops for getting input and doing the commands.
12First it checks to see if there is a batch file(note: there is a global struct "bc" which is NULL when not processing a batch file)
13and if there is it will pull a new line from that file.  If not, then it will wait for input.
14Currently there is some stuff for set /a in there, which might stay there or see if we can find a better spot.
15
16Once there is input taken in from the command line it is sent into ParseCommandLine().
17In here we fist check for aliases and convert if need be.
18Then we look for redirections using GetRedirection() which will remove any redirection symbols.
19and pass back info about where to redirect.
20from this info it will do some switching around with the handles for where things go and send them as need be.
21personally i dont like this code and i tried to change it before but failed.
22it is confusing to me and i dont understand why a lot of it is there but apparently it is needed.
23
24It sends the new string without any redirection info into DoCommand(). In this function we just look to see what should be done.
25There is one of 2 things that could happen.
261) we fnd the matching command and send it off to that commands little section.
272) we dont find it so we send it to Execute() and see if it is a file that we can do something.
28
29Execute will try to launch the file using createprocess and falls back on shellexecute.
30It calls a function called SearchForExecutable() to find the full path name and looks in all the correct locations like PATH,
31 current folder, windows folder.  If it cant find it, just fails and prints out a message.
32
33Some useful functions that are used a lot:
34
35split() - splits a string into an array of string on spaces that aren't inside quotes. which you need to call freep() on later t clean up.
36//Split it�s used to take the Arguments from Command Line, it�s the best option for almost all the cases.
37//If the Command has special needs as Dir, it�s better to make a Parser INSIDE that Command(as DIR has)
38//Dont get mad(as i did): Split() can be find in Misc.c file.Really easy to follow.
39//Also remember split() receives the Command Line, but the Command Line WITHOUT command name.
40
41splitspace()-split a string into an array of string using spaces as splitters.which you need to call freep() on later to clean up.
42//This is the son of split() for commands that manage in the same way "/" and "\" when are INSIDE the paths.
43//i.e move works in the same way with: move C:\this/is\a/mess C:\i/know,and with move C:/this/is/a/mess C:/i/know
44//Other commands DOESNT.
45//You can find also in misc.c
46
47IsValidPathName(), IsExistingFile(), IsExistingDirectory() - all do what you would expect.
48PagePrompt() -  ask them to hit a key to continue
49FilePromptYN[A]() - ask them a yes or no question
50