mirror of
https://github.com/reactos/reactos.git
synced 2025-07-07 18:17:56 +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,17 +1787,18 @@ 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"));
|
|
||||||
}
|
|
||||||
else if (IsExistingFile (_T("\\cmdstart.bat")))
|
|
||||||
{
|
|
||||||
ParseCommandLine (_T("\\cmdstart.bat"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ExecuteAutoRunFile ();
|
||||||
|
|
||||||
#ifdef FEATURE_DIR_STACK
|
#ifdef FEATURE_DIR_STACK
|
||||||
/* initialize directory stack */
|
/* initialize directory stack */
|
||||||
InitDirectoryStack ();
|
InitDirectoryStack ();
|
||||||
|
|
|
@ -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