0

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.

0

Set the current path to %CURRENT_PATH%..

.. = parent directory. . = current directory.

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

1
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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