- Remove hard-coded reference to cmdstart.bat and load it from registry (Software...
authorMarc Piulachs <marc.piulachs@live.com>
Sun, 23 Dec 2007 13:27:00 +0000 (13:27 +0000)
committerMarc Piulachs <marc.piulachs@live.com>
Sun, 23 Dec 2007 13:27:00 +0000 (13:27 +0000)
- Show a simple version information when called without command line parameters like the ms's cmd.exe does.

svn path=/trunk/; revision=31413

reactos/base/shell/cmd/cmd.c
reactos/base/shell/cmd/cmd.rbuild
reactos/boot/bootdata/hivesft.inf

index 2dc8604..f2b9243 100644 (file)
@@ -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 */
-       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 */
 
 #ifdef FEATURE_DIR_STACK
        /* initialize directory stack */
index ef0537d..8044a09 100644 (file)
@@ -1,84 +1,84 @@
 <?xml version="1.0"?>
 <!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd">
 <group>
 <?xml version="1.0"?>
 <!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd">
 <group>
-<module name="cmd_base" type="objectlibrary">
-       <include base="ReactOS">include/reactos/wine</include>
-       <include base="cmd_base">.</include>
-       <define name="ANONYMOUSUNIONS" />
-       <define name="_WIN32_WINNT">0x0501</define>
-       <define name="_DEBUG_MEM" />
-       <define name="UNICODE" />
-       <define name="_UNICODE" />
-       <pch>precomp.h</pch>
-       <compilationunit name="unit.c">
-               <file>alias.c</file>
-               <file>attrib.c</file>
-               <file>batch.c</file>
-               <file>beep.c</file>
-               <file>call.c</file>
-               <file>chcp.c</file>
-               <file>choice.c</file>
-               <file>cls.c</file>
-               <file>cmd.c</file>
-               <file>cmddbg.c</file>
-               <file>cmdinput.c</file>
-               <file>cmdtable.c</file>
-               <file>color.c</file>
-               <file>console.c</file>
-               <file>copy.c</file>
-               <file>date.c</file>
-               <file>del.c</file>
-               <file>delay.c</file>
-               <file>dir.c</file>
-               <file>dirstack.c</file>
-               <file>echo.c</file>
-               <file>error.c</file>
-               <file>filecomp.c</file>
-               <file>for.c</file>
-               <file>free.c</file>
-               <file>goto.c</file>
-               <file>history.c</file>
-               <file>if.c</file>
-               <file>internal.c</file>
-               <file>label.c</file>
-               <file>locale.c</file>
-               <file>memory.c</file>
-               <file>misc.c</file>
-               <file>move.c</file>
-               <file>msgbox.c</file>
-               <file>path.c</file>
-               <file>pause.c</file>
-               <file>prompt.c</file>
-               <file>redir.c</file>
-               <file>ren.c</file>
-               <file>replace.c</file>
-               <file>screen.c</file>
-               <file>set.c</file>
-               <file>shift.c</file>
-               <file>start.c</file>
-               <file>strtoclr.c</file>
-               <file>time.c</file>
-               <file>timer.c</file>
-               <file>title.c</file>
-               <file>type.c</file>
-               <file>ver.c</file>
-               <file>verify.c</file>
-               <file>vol.c</file>
-               <file>where.c</file>
-               <file>window.c</file>
-       </compilationunit>
-</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" />
-       <define name="_WIN32_WINNT">0x0501</define>
-       <library>cmd_base</library>
-       <library>kernel32</library>
-       <library>advapi32</library>
-       <library>shell32</library>
-       <library>user32</library>
-       <file>cmd.rc</file>
-       <file>main.c</file>
-</module>
+       <module name="cmd_base" type="objectlibrary">
+               <include base="ReactOS">include/reactos/wine</include>
+               <include base="cmd_base">.</include>
+               <define name="ANONYMOUSUNIONS" />
+               <define name="_WIN32_WINNT">0x0501</define>
+               <define name="_DEBUG_MEM" />
+               <define name="UNICODE" />
+               <define name="_UNICODE" />
+               <pch>precomp.h</pch>
+               <compilationunit name="unit.c">
+                       <file>alias.c</file>
+                       <file>attrib.c</file>
+                       <file>batch.c</file>
+                       <file>beep.c</file>
+                       <file>call.c</file>
+                       <file>chcp.c</file>
+                       <file>choice.c</file>
+                       <file>cls.c</file>
+                       <file>cmd.c</file>
+                       <file>cmddbg.c</file>
+                       <file>cmdinput.c</file>
+                       <file>cmdtable.c</file>
+                       <file>color.c</file>
+                       <file>console.c</file>
+                       <file>copy.c</file>
+                       <file>date.c</file>
+                       <file>del.c</file>
+                       <file>delay.c</file>
+                       <file>dir.c</file>
+                       <file>dirstack.c</file>
+                       <file>echo.c</file>
+                       <file>error.c</file>
+                       <file>filecomp.c</file>
+                       <file>for.c</file>
+                       <file>free.c</file>
+                       <file>goto.c</file>
+                       <file>history.c</file>
+                       <file>if.c</file>
+                       <file>internal.c</file>
+                       <file>label.c</file>
+                       <file>locale.c</file>
+                       <file>memory.c</file>
+                       <file>misc.c</file>
+                       <file>move.c</file>
+                       <file>msgbox.c</file>
+                       <file>path.c</file>
+                       <file>pause.c</file>
+                       <file>prompt.c</file>
+                       <file>redir.c</file>
+                       <file>ren.c</file>
+                       <file>replace.c</file>
+                       <file>screen.c</file>
+                       <file>set.c</file>
+                       <file>shift.c</file>
+                       <file>start.c</file>
+                       <file>strtoclr.c</file>
+                       <file>time.c</file>
+                       <file>timer.c</file>
+                       <file>title.c</file>
+                       <file>type.c</file>
+                       <file>ver.c</file>
+                       <file>verify.c</file>
+                       <file>vol.c</file>
+                       <file>where.c</file>
+                       <file>window.c</file>
+               </compilationunit>
+       </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" />
+               <define name="_WIN32_WINNT">0x0501</define>
+               <library>cmd_base</library>
+               <library>kernel32</library>
+               <library>advapi32</library>
+               <library>shell32</library>
+               <library>user32</library>
+               <file>cmd.rc</file>
+               <file>main.c</file>
+       </module>
 </group>
 </group>
index c6077f2..5c2996d 100644 (file)
@@ -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
 
 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
 
 ; Uninstall Application list
 HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",,0x00000010