From d427f731f0128f5d6df1ae6e5c5a73ef4fe0ed34 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 4 Nov 2002 22:49:11 +0000 Subject: [PATCH] Make COMSPEC point to wcmd.exe, not command.com. --- files/directory.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/files/directory.c b/files/directory.c index 6967fd505b3..fd13de238f1 100644 --- a/files/directory.c +++ b/files/directory.c @@ -119,6 +119,8 @@ int DIR_Init(void) static const WCHAR winsysdirW[] = {'w','i','n','s','y','s','d','i','r',0}; static const WCHAR userprofileW[] = {'U','S','E','R','P','R','O','F','I','L','E',0}; static const WCHAR systemrootW[] = {'S','Y','S','T','E','M','R','O','O','T',0}; + static const WCHAR wcmdW[] = {'\\','w','c','m','d','.','e','x','e',0}; + static const WCHAR comspecW[] = {'C','O','M','S','P','E','C',0}; static const WCHAR empty_strW[] = { 0 }; if (!getcwd( path, MAX_PATHNAME_LEN )) @@ -171,6 +173,14 @@ int DIR_Init(void) /* Set the environment variables */ + /* set COMSPEC only if it doesn't exist already */ + if (!GetEnvironmentVariableW( comspecW, NULL, 0 )) + { + strcpyW( longpath, DIR_System.short_name ); + strcatW( longpath, wcmdW ); + SetEnvironmentVariableW( comspecW, longpath ); + } + /* set PATH only if not set already */ if (!GetEnvironmentVariableW( path_capsW, longpath, MAX_PATHNAME_LEN )) { @@ -189,10 +199,6 @@ int DIR_Init(void) SetEnvironmentVariableW( windirW, DIR_Windows.short_name ); SetEnvironmentVariableW( winsysdirW, DIR_System.short_name ); - /* set COMSPEC only if it doesn't exist already */ - if (!GetEnvironmentVariableA( "COMSPEC", NULL, 0 )) - SetEnvironmentVariableA( "COMSPEC", "c:\\command.com" ); - TRACE("WindowsDir = %s (%s)\n", debugstr_w(DIR_Windows.short_name), DIR_Windows.long_name ); TRACE("SystemDir = %s (%s)\n", -- 2.11.4.GIT