mirror of
https://github.com/reactos/reactos.git
synced 2025-07-07 06:11:22 +00:00
- Remove hard-coded reference to cmdstart.bat and load it from registry (Software\Microsoft\Command Processor\Autorun)
- Show a simple version information when called without command line parameters like the ms's cmd.exe does. svn path=/trunk/; revision=31413
This commit is contained in:
parent
945a21ed67
commit
e20421e167
3 changed files with 120 additions and 89 deletions
|
@ -1608,6 +1608,33 @@ ShowCommands (VOID)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static VOID
|
||||||
|
ExecuteAutoRunFile (VOID)
|
||||||
|
{
|
||||||
|
TCHAR autorun[MAX_PATH];
|
||||||
|
DWORD len = MAX_PATH;
|
||||||
|
HKEY hkey;
|
||||||
|
|
||||||
|
if( RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||||
|
_T("SOFTWARE\\Microsoft\\Command Processor"),
|
||||||
|
0,
|
||||||
|
KEY_READ,
|
||||||
|
&hkey ) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
if(RegQueryValueEx(hkey,
|
||||||
|
_T("AutoRun"),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
(LPBYTE)autorun,
|
||||||
|
&len) == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
ParseCommandLine (autorun);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RegCloseKey(hkey);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* set up global initializations and process parameters
|
* set up global initializations and process parameters
|
||||||
*
|
*
|
||||||
|
@ -1760,16 +1787,17 @@ Initialize (int argc, const TCHAR* argv[])
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Display a simple version string */
|
||||||
|
ConOutPrintf(_T("ReactOS Operating System [Version %s-%s]\n"),
|
||||||
|
_T(KERNEL_RELEASE_STR),
|
||||||
|
_T(KERNEL_VERSION_BUILD_STR));
|
||||||
|
|
||||||
/* run cmdstart.bat */
|
ConOutPuts (_T("(C) Copyright 1998-2008 ReactOS Team.\n"));
|
||||||
if (IsExistingFile (_T("cmdstart.bat")))
|
}
|
||||||
{
|
|
||||||
ParseCommandLine (_T("cmdstart.bat"));
|
ExecuteAutoRunFile ();
|
||||||
}
|
|
||||||
else if (IsExistingFile (_T("\\cmdstart.bat")))
|
|
||||||
{
|
|
||||||
ParseCommandLine (_T("\\cmdstart.bat"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef FEATURE_DIR_STACK
|
#ifdef FEATURE_DIR_STACK
|
||||||
/* initialize directory stack */
|
/* initialize directory stack */
|
||||||
|
|
|
@ -1,84 +1,84 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd">
|
<!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd">
|
||||||
<group>
|
<group>
|
||||||
<module name="cmd_base" type="objectlibrary">
|
<module name="cmd_base" type="objectlibrary">
|
||||||
<include base="ReactOS">include/reactos/wine</include>
|
<include base="ReactOS">include/reactos/wine</include>
|
||||||
<include base="cmd_base">.</include>
|
<include base="cmd_base">.</include>
|
||||||
<define name="ANONYMOUSUNIONS" />
|
<define name="ANONYMOUSUNIONS" />
|
||||||
<define name="_WIN32_WINNT">0x0501</define>
|
<define name="_WIN32_WINNT">0x0501</define>
|
||||||
<define name="_DEBUG_MEM" />
|
<define name="_DEBUG_MEM" />
|
||||||
<define name="UNICODE" />
|
<define name="UNICODE" />
|
||||||
<define name="_UNICODE" />
|
<define name="_UNICODE" />
|
||||||
<pch>precomp.h</pch>
|
<pch>precomp.h</pch>
|
||||||
<compilationunit name="unit.c">
|
<compilationunit name="unit.c">
|
||||||
<file>alias.c</file>
|
<file>alias.c</file>
|
||||||
<file>attrib.c</file>
|
<file>attrib.c</file>
|
||||||
<file>batch.c</file>
|
<file>batch.c</file>
|
||||||
<file>beep.c</file>
|
<file>beep.c</file>
|
||||||
<file>call.c</file>
|
<file>call.c</file>
|
||||||
<file>chcp.c</file>
|
<file>chcp.c</file>
|
||||||
<file>choice.c</file>
|
<file>choice.c</file>
|
||||||
<file>cls.c</file>
|
<file>cls.c</file>
|
||||||
<file>cmd.c</file>
|
<file>cmd.c</file>
|
||||||
<file>cmddbg.c</file>
|
<file>cmddbg.c</file>
|
||||||
<file>cmdinput.c</file>
|
<file>cmdinput.c</file>
|
||||||
<file>cmdtable.c</file>
|
<file>cmdtable.c</file>
|
||||||
<file>color.c</file>
|
<file>color.c</file>
|
||||||
<file>console.c</file>
|
<file>console.c</file>
|
||||||
<file>copy.c</file>
|
<file>copy.c</file>
|
||||||
<file>date.c</file>
|
<file>date.c</file>
|
||||||
<file>del.c</file>
|
<file>del.c</file>
|
||||||
<file>delay.c</file>
|
<file>delay.c</file>
|
||||||
<file>dir.c</file>
|
<file>dir.c</file>
|
||||||
<file>dirstack.c</file>
|
<file>dirstack.c</file>
|
||||||
<file>echo.c</file>
|
<file>echo.c</file>
|
||||||
<file>error.c</file>
|
<file>error.c</file>
|
||||||
<file>filecomp.c</file>
|
<file>filecomp.c</file>
|
||||||
<file>for.c</file>
|
<file>for.c</file>
|
||||||
<file>free.c</file>
|
<file>free.c</file>
|
||||||
<file>goto.c</file>
|
<file>goto.c</file>
|
||||||
<file>history.c</file>
|
<file>history.c</file>
|
||||||
<file>if.c</file>
|
<file>if.c</file>
|
||||||
<file>internal.c</file>
|
<file>internal.c</file>
|
||||||
<file>label.c</file>
|
<file>label.c</file>
|
||||||
<file>locale.c</file>
|
<file>locale.c</file>
|
||||||
<file>memory.c</file>
|
<file>memory.c</file>
|
||||||
<file>misc.c</file>
|
<file>misc.c</file>
|
||||||
<file>move.c</file>
|
<file>move.c</file>
|
||||||
<file>msgbox.c</file>
|
<file>msgbox.c</file>
|
||||||
<file>path.c</file>
|
<file>path.c</file>
|
||||||
<file>pause.c</file>
|
<file>pause.c</file>
|
||||||
<file>prompt.c</file>
|
<file>prompt.c</file>
|
||||||
<file>redir.c</file>
|
<file>redir.c</file>
|
||||||
<file>ren.c</file>
|
<file>ren.c</file>
|
||||||
<file>replace.c</file>
|
<file>replace.c</file>
|
||||||
<file>screen.c</file>
|
<file>screen.c</file>
|
||||||
<file>set.c</file>
|
<file>set.c</file>
|
||||||
<file>shift.c</file>
|
<file>shift.c</file>
|
||||||
<file>start.c</file>
|
<file>start.c</file>
|
||||||
<file>strtoclr.c</file>
|
<file>strtoclr.c</file>
|
||||||
<file>time.c</file>
|
<file>time.c</file>
|
||||||
<file>timer.c</file>
|
<file>timer.c</file>
|
||||||
<file>title.c</file>
|
<file>title.c</file>
|
||||||
<file>type.c</file>
|
<file>type.c</file>
|
||||||
<file>ver.c</file>
|
<file>ver.c</file>
|
||||||
<file>verify.c</file>
|
<file>verify.c</file>
|
||||||
<file>vol.c</file>
|
<file>vol.c</file>
|
||||||
<file>where.c</file>
|
<file>where.c</file>
|
||||||
<file>window.c</file>
|
<file>window.c</file>
|
||||||
</compilationunit>
|
</compilationunit>
|
||||||
</module>
|
</module>
|
||||||
<module name="cmd" type="win32cui" installbase="system32" installname="cmd.exe" unicode="yes">
|
<module name="cmd" type="win32cui" installbase="system32" installname="cmd.exe" unicode="yes">
|
||||||
<include base="ReactOS">include/reactos/wine</include>
|
<include base="ReactOS">include/reactos/wine</include>
|
||||||
<include base="cmd">.</include>
|
<include base="cmd">.</include>
|
||||||
<define name="ANONYMOUSUNIONS" />
|
<define name="ANONYMOUSUNIONS" />
|
||||||
<define name="_WIN32_WINNT">0x0501</define>
|
<define name="_WIN32_WINNT">0x0501</define>
|
||||||
<library>cmd_base</library>
|
<library>cmd_base</library>
|
||||||
<library>kernel32</library>
|
<library>kernel32</library>
|
||||||
<library>advapi32</library>
|
<library>advapi32</library>
|
||||||
<library>shell32</library>
|
<library>shell32</library>
|
||||||
<library>user32</library>
|
<library>user32</library>
|
||||||
<file>cmd.rc</file>
|
<file>cmd.rc</file>
|
||||||
<file>main.c</file>
|
<file>main.c</file>
|
||||||
</module>
|
</module>
|
||||||
</group>
|
</group>
|
||||||
|
|
|
@ -8,6 +8,9 @@ HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders",,0x00000
|
||||||
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders",,0x00000012
|
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders",,0x00000012
|
||||||
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce",,0x00000012
|
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce",,0x00000012
|
||||||
|
|
||||||
|
; CMD Settings
|
||||||
|
HKLM,"SOFTWARE\Microsoft\Command Processor","AutoRun",0x00020000,""
|
||||||
|
|
||||||
; Uninstall Application list
|
; Uninstall Application list
|
||||||
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",,0x00000010
|
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",,0x00000010
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue