mirror of
https://github.com/reactos/reactos.git
synced 2025-07-07 03:21: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
|
||||
|
||||
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
|
||||
*
|
||||
|
@ -1760,17 +1787,18 @@ Initialize (int argc, const TCHAR* argv[])
|
|||
#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 */
|
||||
if (IsExistingFile (_T("cmdstart.bat")))
|
||||
{
|
||||
ParseCommandLine (_T("cmdstart.bat"));
|
||||
}
|
||||
else if (IsExistingFile (_T("\\cmdstart.bat")))
|
||||
{
|
||||
ParseCommandLine (_T("\\cmdstart.bat"));
|
||||
ConOutPuts (_T("(C) Copyright 1998-2008 ReactOS Team.\n"));
|
||||
}
|
||||
|
||||
ExecuteAutoRunFile ();
|
||||
|
||||
#ifdef FEATURE_DIR_STACK
|
||||
/* initialize directory stack */
|
||||
InitDirectoryStack ();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd">
|
||||
<group>
|
||||
<module name="cmd_base" type="objectlibrary">
|
||||
<module name="cmd_base" type="objectlibrary">
|
||||
<include base="ReactOS">include/reactos/wine</include>
|
||||
<include base="cmd_base">.</include>
|
||||
<define name="ANONYMOUSUNIONS" />
|
||||
|
@ -67,8 +67,8 @@
|
|||
<file>where.c</file>
|
||||
<file>window.c</file>
|
||||
</compilationunit>
|
||||
</module>
|
||||
<module name="cmd" type="win32cui" installbase="system32" installname="cmd.exe" unicode="yes">
|
||||
</module>
|
||||
<module name="cmd" type="win32cui" installbase="system32" installname="cmd.exe" unicode="yes">
|
||||
<include base="ReactOS">include/reactos/wine</include>
|
||||
<include base="cmd">.</include>
|
||||
<define name="ANONYMOUSUNIONS" />
|
||||
|
@ -80,5 +80,5 @@
|
|||
<library>user32</library>
|
||||
<file>cmd.rc</file>
|
||||
<file>main.c</file>
|
||||
</module>
|
||||
</module>
|
||||
</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\RunOnce",,0x00000012
|
||||
|
||||
; CMD Settings
|
||||
HKLM,"SOFTWARE\Microsoft\Command Processor","AutoRun",0x00020000,""
|
||||
|
||||
; Uninstall Application list
|
||||
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",,0x00000010
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue