Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can someone help me figure out how to set a variable path in Windows Server 2003? I am trying to do the below code which is not working.

Update: My issue might actually be that the CURRENT PATH needs to be up one level. How do I set the current path to the current path but up one directory higher?


I tried both these ways.


set RELEASE_DIR=%CD%\release

set WIN_RUN_CMD=runBuild.cmd %CD% %CD%\cmtmp
set WIN_RUN_CMD=runBuild.cmd %CURRENT_PATH% %CURRENT_PATH%\cmtmp

I have come across individuals saying to use for example, %~d0. I have tried this and it does not appear to be working on Windows Server 2003.

share|improve this question

Set the current path to %CURRENT_PATH%..

.. = parent directory. . = current directory.

(ever notice on a DIR listing there are two directories - .. and .?)

share|improve this answer
Thanks. I tried this and it didn't work. Gave me errors. However, I did figure it out. I had to use pushd and popd. set CURRENT_PATH=%CD% echo CURRENT_PATH = %CURRENT_PATH% pushd .. set BUILD_PATH=%CD% echo BUILD_PATH = %BUILD_PATH% popd – Jay May 13 '13 at 20:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.