For the life of me, I can't figure out how to get a parent directory of the directory I'm in. wtf
Anyone?
Anyone?
FOR %%c IN ("%~dp0..\*.*") do SET PARDIR=%%~dpc
ECHO %PARDIR%
Doesn't work.
I came up with this, which will work, but there has to be something easier than this.
Code:FOR %%c IN ("%~dp0..\*.*") do SET PARDIR=%%~dpc ECHO %PARDIR%
it works by itself...maybe your syntax is off?
Am I doing it wrong? I need it as a variable. If I go to a command prompt and type 'ECHO CD..' I get: CD..
Why are you programing in DOS? What's the project?
Why are you programing in DOS? What's the project?
set CurDir=%CD%
cd ..
set ParDir=%CD%
cd %CurDir%
echo %ParDir%
echo %CurDir%
pushd %CD%
cd ..
set ParDir=%CD%
popd
echo %ParDir%
interesting. I've never even heard of pushd and popd.
Almost bordering on C programming
Agreed. I took a compiler class that was brutally boring. Goddamn stacks.I learned all of thhat in comp sci classes. Good to know to boring to learn.