Index: /trunk/kBuild/tools/VCC120AMD64.kmk
===================================================================
--- /trunk/kBuild/tools/VCC120AMD64.kmk	(revision 3043)
+++ /trunk/kBuild/tools/VCC120AMD64.kmk	(revision 3044)
@@ -58,5 +58,7 @@
 if "$(KBUILD_HOST).$(KBUILD_HOST_ARCH)" == "win.amd64" && exists("$(PATH_TOOL_VCC120AMD64)/bin/amd64") # Missing in express edition.
 PATH_TOOL_VCC120AMD64_BIN ?= $(PATH_TOOL_VCC120AMD64)/bin/amd64
+#$(error works now: $(PATH_TOOL_VCC120AMD64)/bin/amd64)
 else
+#$(error no joy: $(PATH_TOOL_VCC120AMD64)/bin/amd64)
 PATH_TOOL_VCC120AMD64_BIN_DLL ?= $(PATH_TOOL_VCC120AMD64)/bin
 PATH_TOOL_VCC120AMD64_BIN ?= $(PATH_TOOL_VCC120AMD64)/bin/x86_amd64
@@ -81,4 +83,7 @@
   ifneq ($(substr $(PATH_TOOL_VCC120AMD64_BIN),-9),x86_amd64)
    TOOL_VCC120AMD64_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
+   ifdef PATH_TOOL_VCC120AMD64_BIN_DLL
+    TOOL_VCC120AMD64_KSUBMIT += --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)'
+   endif
    TOOL_VCC120AMD64_KSUBMIT_DD = $(TOOL_VCC120AMD64_KSUBMIT) --
   else
@@ -89,5 +94,5 @@
  endif
 else ifdef PATH_TOOL_VCC120AMD64_BIN_DLL
- TOOL_VCC120AMD64_KSUBMIT_DD  = $(REDIRECT) -E 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)$(PATH)' --
+ TOOL_VCC120AMD64_KSUBMIT_DD  = $(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' --
 endif
 
@@ -166,5 +171,4 @@
  define TOOL_VCC120AMD64_COMPILE_C_CMDS
 	$(QUIET)$(TOOL_VCC120AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
-		$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL),-E 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)$(PATH)',)\
 		-- $(TOOL_VCC120AMD64_CC) -c\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
@@ -176,5 +180,5 @@
  define TOOL_VCC120AMD64_COMPILE_C_CMDS
 	$(QUIET)$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL)\
-		,$(REDIRECT) -E 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)$(PATH)' -- ,)$(TOOL_VCC120AMD64_CC) -c\
+		,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120AMD64_CC) -c\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 		-Fd$(outbase)-obj.pdb \
@@ -208,5 +212,4 @@
  define TOOL_VCC120AMD64_COMPILE_CXX_CMDS
 	$(QUIET)$(TOOL_VCC120AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
-		$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL),-E 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)$(PATH)',)\
 		-- $(TOOL_VCC120AMD64_CXX) -c\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
@@ -220,5 +223,5 @@
  define TOOL_VCC120AMD64_COMPILE_CXX_CMDS
 	$(QUIET)$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL)\
-		,$(REDIRECT) -E 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)$(PATH)' -- ,)$(TOOL_VCC120AMD64_CXX) -c\
+		,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120AMD64_CXX) -c\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 		$(if-expr defined($(target)_PCH_HDR)\
@@ -255,5 +258,4 @@
 	$(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
 	$(QUIET)$(TOOL_VCC120AMD64_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
-		$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL),-E 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)$(PATH)',)\
 		-- $(TOOL_VCC120AMD64_CXX) -c -Yc\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
@@ -268,5 +270,5 @@
 	$(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
 	$(QUIET)$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL)\
-		,$(REDIRECT) -E 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)$(PATH)' -- ,)$(TOOL_VCC120AMD64_CXX) -c -Yc\
+		,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120AMD64_CXX) -c -Yc\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
                -Fp$($(target)_1_VCC_PCH_FILE) \
@@ -302,5 +304,5 @@
 define TOOL_VCC120AMD64_COMPILE_RC_CMDS
 	$(QUIET)$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL)\
-		,PATH='$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)$(PATH)',)$(TOOL_VCC120AMD64_RC) \
+		,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120AMD64_RC) \
 		$(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
 		/fo$(obj)\
Index: /trunk/kBuild/tools/VCC120X86.kmk
===================================================================
--- /trunk/kBuild/tools/VCC120X86.kmk	(revision 3043)
+++ /trunk/kBuild/tools/VCC120X86.kmk	(revision 3044)
@@ -85,9 +85,16 @@
 ifdef TOOL_VCC120X86_USE_KSUBMIT
  ifeq ($(KBUILD_HOST),win)
-  TOOL_VCC120X86_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
+  if  "$(substr $(PATH_TOOL_VCC120X86_BIN),-10)" == "/amd64_x86"
+   TOOL_VCC120X86_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
+  else
+   TOOL_VCC120X86_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
+  endif
+  ifdef PATH_TOOL_VCC120X86_BIN_DLL
+   TOOL_VCC120X86_KSUBMIT += --prepend 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)'
+  endif
   TOOL_VCC120X86_KSUBMIT_DD = $(TOOL_VCC120X86_KSUBMIT) --
  endif
 else ifdef PATH_TOOL_VCC120X86_BIN_DLL
- TOOL_VCC120X86_KSUBMIT_DD  = $(REDIRECT) -E 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)$(PATH)' --
+ TOOL_VCC120X86_KSUBMIT_DD  = $(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)' --
 endif
 
@@ -134,5 +141,5 @@
 TOOL_VCC120X86_RCINCS           ?= $(PATH_TOOL_VCC120X86_INC) $(PATH_TOOL_VCC120X86_ATLMFC_INC)
 
-TOOL_VCC120X86_ARFLAGS          ?= -nologo
+TOOL_VCC120X86_ARFLAGS          ?= -nologo -machine:x86
 TOOL_VCC120X86_ARLIBSUFF        ?= .lib
 
@@ -166,5 +173,4 @@
  define TOOL_VCC120X86_COMPILE_C_CMDS
 	$(QUIET)$(TOOL_VCC120X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
-		$(if-expr defined(PATH_TOOL_VCC120X86_BIN_DLL),-E 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)$(PATH)',)\
 		-- $(TOOL_VCC120X86_CC) -c\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
@@ -176,5 +182,5 @@
  define TOOL_VCC120X86_COMPILE_C_CMDS
 	$(QUIET)$(if-expr defined(PATH_TOOL_VCC120X86_BIN_DLL)\
-		,$(REDIRECT) -E 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)$(PATH)' -- ,)$(TOOL_VCC120X86_CC) -c\
+		,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120X86_CC) -c\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 		-Fd$(outbase)-obj.pdb \
@@ -208,5 +214,4 @@
  define TOOL_VCC120X86_COMPILE_CXX_CMDS
 	$(QUIET)$(TOOL_VCC120X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
-		$(if-expr defined(PATH_TOOL_VCC120X86_BIN_DLL),-E 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)$(PATH)',)\
 		-- $(TOOL_VCC120X86_CXX) -c\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
@@ -220,5 +225,5 @@
  define TOOL_VCC120X86_COMPILE_CXX_CMDS
 	$(QUIET)$(if-expr defined(PATH_TOOL_VCC120X86_BIN_DLL)\
-		,$(REDIRECT) -E 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)$(PATH)' -- ,)$(TOOL_VCC120X86_CXX) -c\
+		,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120X86_CXX) -c\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 		$(if-expr defined($(target)_PCH_HDR)\
@@ -254,5 +259,4 @@
  define TOOL_VCC120X86-PCH_COMPILE_CXX_CMDS
 	$(QUIET)$(TOOL_VCC120X86_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
-		$(if-expr defined(PATH_TOOL_VCC120X86_BIN_DLL),-E 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)$(PATH)',)\
 		-- $(TOOL_VCC120X86_CXX) -c -Yc\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
@@ -266,5 +270,5 @@
  define TOOL_VCC120X86-PCH_COMPILE_CXX_CMDS
 	$(QUIET)$(if-expr defined(PATH_TOOL_VCC120X86_BIN_DLL)\
-		,$(REDIRECT) -E 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)$(PATH)' -- ,)$(TOOL_VCC120X86_CXX) -c -Yc\
+		,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120X86_CXX) -c -Yc\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
                -Fp$($(target)_1_VCC_PCH_FILE) \
@@ -300,5 +304,5 @@
 define TOOL_VCC120X86_COMPILE_RC_CMDS
 	$(QUIET)$(if-expr defined(PATH_TOOL_VCC120X86_BIN_DLL)\
-		,PATH='$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)$(PATH)') $(TOOL_VCC120X86_RC) \
+		,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)' -- ,) $(TOOL_VCC120X86_RC) \
 		$(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
 		/fo$(obj)\
