title: Activate python 3 environemnt in Anaconda with batch-file
body: <p>Recently installed Anaconda (1.9) for my python project on win7</p>
  
  <p>After installation, I built a python 3 support environment with instruction in <a href="http://continuum.io/blog/anaconda-python-3" rel="nofollow">this page</a>. My next task is to activate my python environment automatically with built-in batch file. </p>
  
  <p>I used the command in [Anaconda Command Prompt] shortcut I found in my start menu. It runs a batch-file called [<strong>anaconda.bat</strong>]</p>
  
  <p>After observing the batch file I realized it seems to be capable of taking an input argument that is supposed to be the environment I would like to activate. So I copied the shortcut and modified it as </p>
  
  <pre><code>C:\Windows\System32\cmd.exe /k "C:\Anaconda\Scripts\anaconda.bat py3k"
  </code></pre>
  
  <p>Then I double clicked on the new shortcut, it opened a new command window but...the designated environment did not activate!</p>
  
  <pre><code>@echo off
  
  rem +===========================================================================
  rem | Initialisation
  rem +===========================================================================
  verify bogus-argument 2&gt;nul
  setlocal enableextensions enabledelayedexpansion
  if ERRORLEVEL 1 (
      echo error: unable to enable command extensions
      goto :eof
  )
  
  for %%i in ("%~dp0..\envs") do (
      set ANACONDA_ENVS=%%~fi
  )
  
  if not "%1" == "" (
      if not exist "%ANACONDA_ENVS%\%1\python.exe" (
          echo No environment named "%1" exists in %ANACONDA_ENVS%
          goto :eof
      )
      set ANACONDA_ENV_NAME=%1
      set ANACONDA=%ANACONDA_ENVS%\%1
      title Anaconda (%ANACONDA_ENV_NAME%^)
  ) else (
      set ANACONDA_ENV_NAME=
      for %%i in ("%~dp0..") do (
          set ANACONDA=%%~fi
      )
      title Anaconda
  )
  
  set ANACONDA_SCRIPTS=%ANACONDA%\Scripts
  
  for %%i in ("python.exe") do (
      for %%j in ("%ANACONDA%\python.exe") do (
          if not "%%~f$PATH:i" == "%%~f$PATH:j" (
              set ANACONDA_OLD_PATH="%PATH%"
              set PATH=%ANACONDA%;%ANACONDA_SCRIPTS%;%PATH%;
              echo Added %ANACONDA% and %ANACONDA_SCRIPTS% to PATH.
          )
      )
  )
  
  if not "%ANACONDA_ENV_NAME%" == "" (
      echo Activating environment %ANACONDA_ENV_NAME%...
      set PROMPT=[%ANACONDA_ENV_NAME%] $P$G
  )
  </code></pre>
  
  <p>I have very little experience with bat language but I guess there may be something to do with this line </p>
  
  <pre><code>setlocal enableextensions enabledelayedexpansion
  </code></pre>
  
  <p>I tried to remove that line but kept trapped in the ERRORLEVEL 1 expression with message. </p>
  
  <pre><code>error: unable to enable command extensions
  </code></pre>
  
  <p>Can anyone suggest what I should do to make this bat-file work properly? </p>