title: Batch - get current directory before the 'UNC error' modifies cd variable
body: <p>When I run a batch file on a network drive, i get the "UNC Paths not supported" error.</p>
  
  <p>I want to store the current directory of the batch file in a variable so i can switch to it via the <code>pushd</code> command, before the current directory changes to "C:\Windows".</p>
  
  <p>Sorry if I missed something!</p>
  
  <p>EDIT:</p>
  
  <p>Heres the code:</p>
  
  <pre><code>@echo off
  SETLOCAL EnableExtensions
  title School Minecraft Hunger Games Launcher
  set appdata=%cd%\core
  set usrname=%USERNAME%
  :lol
  cls
  set choice=
  echo -------------------------------------------------------------------------------
  echo                         School Minecraft Launcher v4.2                   
  echo                            Minecraft Version: 1.5.2
  echo -------------------------------------------------------------------------------
  echo Logging in with the name "%usrname%". Is this correct? (y/n)
  set /p choice=
  if "%choice%"=="y" goto check
  if "%choice%"=="yes" goto check
  if "%choice%"=="n" goto argue
  if "%choice%"=="no" goto argue
  echo.
  echo That is not a recognized command, Press enter to try again.
  pause &gt; nul
  goto lol
  :argue
  cls
  set provide2=
  echo To change your ingame username, please provide the override password:
  echo.
  echo Type "back" to cancel.
  echo.
  set /p provide2=Password: 
  if "%provide2%"=="changename" goto enternewname
  if "%provide2%"=="back" goto lol
  echo.
  echo Incorrect Password.
  echo.
  echo Press enter to try again...
  pause &gt; nul
  goto argue
  :enternewname
  cls
  echo Please enter new name, then press enter:
  set /p usrname=
  goto lol
  :check
  cls
  if "%usrname%"=="user1" set knee=watermelon
  if "%usrname%"=="user2" set knee=computer
  if "%usrname%"=="user3" set knee=fish
  if "%usrname%"=="user4" set knee=kittens
  :final
  if "%knee%"=="" goto rungame
  cls
  set provide=
  echo -------------------------------------------------------------------------------
  echo                          School Minecraft Launcher v4a                   
  echo                            Minecraft Version: 1.5.2
  echo -------------------------------------------------------------------------------
  echo You are trying to login as an admin. Please provide your password.
  echo.
  echo Username: %usrname%
  set /p provide=Password: 
  if "%knee%"=="%provide%" goto rungame
  echo.
  echo Incorrect password.
  echo.
  echo Press enter to exit...
  pause &gt; nul
  exit
  :rungame
  pushd "%appdata%\.minecraft\bin"
  start javaw -cp minecraft.jar;lwjgl.jar;lwjgl_util.jar -Djava.library.path="natives" net.minecraft.client.Minecraft "%usrname%"
  exit
  </code></pre>
  
  <p>It is supposed to run wherever you put it, so long as you have included a folder called 'core' that contains the games files. Normally it would be: <code>%cd%\core</code>. If you look right down at the bottom of the code, you see it needs to change the directory to: <code>%cd%\core\.minecraft\bin</code> to start the game... But without the current directory variable, I cant do that.</p>