[ros-diffs] [mpiulachs] 31413: - 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.

mpiulachs at svn.reactos.org mpiulachs at svn.reactos.org
Sun Dec 23 14:27:01 CET 2007


Author: mpiulachs
Date: Sun Dec 23 16:27:00 2007
New Revision: 31413

URL: http://svn.reactos.org/svn/reactos?rev=31413&view=rev
Log:
- 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.

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

Modified: trunk/reactos/base/shell/cmd/cmd.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=31413&r1=31412&r2=31413&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/cmd.c (original)
+++ trunk/reactos/base/shell/cmd/cmd.c Sun Dec 23 16:27:00 2007
@@ -1608,6 +1608,33 @@
 }
 #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,16 +1787,17 @@
 #endif
 		}
 	}
-
-	/* run cmdstart.bat */
-	if (IsExistingFile (_T("cmdstart.bat")))
-	{
-		ParseCommandLine (_T("cmdstart.bat"));
-	}
-	else if (IsExistingFile (_T("\\cmdstart.bat")))
-	{
-		ParseCommandLine (_T("\\cmdstart.bat"));
-	}
+    else
+    {
+        /* Display a simple version string */
+        ConOutPrintf(_T("ReactOS Operating System [Version %s-%s]\n"), 
+            _T(KERNEL_RELEASE_STR),
+            _T(KERNEL_VERSION_BUILD_STR));
+
+	    ConOutPuts (_T("(C) Copyright 1998-2008 ReactOS Team.\n"));
+    }
+
+    ExecuteAutoRunFile ();
 
 #ifdef FEATURE_DIR_STACK
 	/* initialize directory stack */

Modified: trunk/reactos/base/shell/cmd/cmd.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.rbuild?rev=31413&r1=31412&r2=31413&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/cmd.rbuild (original)
+++ trunk/reactos/base/shell/cmd/cmd.rbuild Sun Dec 23 16:27:00 2007
@@ -1,84 +1,84 @@
 <?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>

Modified: trunk/reactos/boot/bootdata/hivesft.inf
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesft.inf?rev=31413&r1=31412&r2=31413&view=diff
==============================================================================
--- trunk/reactos/boot/bootdata/hivesft.inf (original)
+++ trunk/reactos/boot/bootdata/hivesft.inf Sun Dec 23 16:27:00 2007
@@ -7,6 +7,9 @@
 HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders",,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




More information about the Ros-diffs mailing list