Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

set CURRENT_PATH=%CD%
echo CURRENT_PATH = %CURRENT_PATH%

I tried both these ways.

set RELEASE_DIR=%CURRENT_PATH%\release
echo RELEASE_DIR = %RELEASE_DIR%

set RELEASE_DIR=%CD%\release
echo RELEASE_DIR = %RELEASE_DIR%

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

1 Answer 1

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

 
discard

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.