mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 09:24:11 +00:00
Add MD command
svn path=/trunk/; revision=1051
This commit is contained in:
parent
d9a0a586a8
commit
15094179f1
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: shell.c,v 1.32 2000/02/29 23:57:44 ea Exp $
|
/* $Id: shell.c,v 1.33 2000/03/12 23:24:51 ekohl Exp $
|
||||||
*
|
*
|
||||||
* PROJECT : ReactOS Operating System
|
* PROJECT : ReactOS Operating System
|
||||||
* DESCRIPTION: ReactOS' Native Shell
|
* DESCRIPTION: ReactOS' Native Shell
|
||||||
|
@ -48,6 +48,14 @@ void ExecuteCd(char* cmdline)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ExecuteMd (char *cmdline)
|
||||||
|
{
|
||||||
|
if (!CreateDirectoryA (cmdline, NULL))
|
||||||
|
{
|
||||||
|
debug_printf("Create Directory failed!\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ExecuteDir(char* cmdline)
|
void ExecuteDir(char* cmdline)
|
||||||
{
|
{
|
||||||
HANDLE shandle;
|
HANDLE shandle;
|
||||||
|
@ -251,6 +259,7 @@ void ExecuteHelp (void * dummy)
|
||||||
"exit\t\t\tTerminate the shell\n"
|
"exit\t\t\tTerminate the shell\n"
|
||||||
"help\t\t\tPrint this help message\n"
|
"help\t\t\tPrint this help message\n"
|
||||||
"kill [pid]\t\tKill process which PID is pid\n"
|
"kill [pid]\t\tKill process which PID is pid\n"
|
||||||
|
"md [directory]\t\tCreate a new directory\n"
|
||||||
"reboot\t\t\tRestart the system\n"
|
"reboot\t\t\tRestart the system\n"
|
||||||
"start [program.exe]\tDetach program.exe\n"
|
"start [program.exe]\tDetach program.exe\n"
|
||||||
"type [file]\t\tPrint the file on console\n"
|
"type [file]\t\tPrint the file on console\n"
|
||||||
|
@ -267,7 +276,6 @@ void ExecuteCommand(char* line)
|
||||||
|
|
||||||
if (isalpha(line[0]) && line[1] == ':' && line[2] == 0)
|
if (isalpha(line[0]) && line[1] == ':' && line[2] == 0)
|
||||||
{
|
{
|
||||||
//#if 0
|
|
||||||
char szPath[MAX_PATH];
|
char szPath[MAX_PATH];
|
||||||
char szVar[5];
|
char szVar[5];
|
||||||
|
|
||||||
|
@ -293,14 +301,6 @@ void ExecuteCommand(char* line)
|
||||||
GetCurrentDirectory (MAX_PATH, szPath);
|
GetCurrentDirectory (MAX_PATH, szPath);
|
||||||
if (szPath[0] != (char)toupper (line[0]))
|
if (szPath[0] != (char)toupper (line[0]))
|
||||||
debug_printf("Invalid drive\n");
|
debug_printf("Invalid drive\n");
|
||||||
//#endif
|
|
||||||
#if 0
|
|
||||||
line[0] = toupper (line[0]);
|
|
||||||
line[2] = '\\';
|
|
||||||
line[3] = 0;
|
|
||||||
if (SetCurrentDirectoryA(line) == FALSE)
|
|
||||||
debug_printf("Invalid drive\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -337,6 +337,11 @@ void ExecuteCommand(char* line)
|
||||||
ExecuteKill(tail);
|
ExecuteKill(tail);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (strcmp(cmd,"md")==0)
|
||||||
|
{
|
||||||
|
ExecuteMd(tail);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (strcmp(cmd,"reboot")==0)
|
if (strcmp(cmd,"reboot")==0)
|
||||||
{
|
{
|
||||||
ExecuteReboot(tail);
|
ExecuteReboot(tail);
|
||||||
|
@ -344,12 +349,12 @@ void ExecuteCommand(char* line)
|
||||||
}
|
}
|
||||||
if (strcmp(cmd,"type")==0)
|
if (strcmp(cmd,"type")==0)
|
||||||
{
|
{
|
||||||
ExecuteType(tail);
|
ExecuteType(tail);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (strcmp(cmd,"ver")==0)
|
if (strcmp(cmd,"ver")==0)
|
||||||
{
|
{
|
||||||
ExecuteVer();
|
ExecuteVer();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (strcmp(cmd,"validate")==0)
|
if (strcmp(cmd,"validate")==0)
|
||||||
|
|
Loading…
Reference in a new issue