views:

352

answers:

1

I'm trying to translate a bash script into a .bat script. The specific line I'm tripping over is this:

X=`pwd`

What is the .bat equivalent?

I need to take the directory that the script is currently running in as a variable so I can use a generic relative path to find files in the directory. I'm running on Windows-XP in the command prompt.

+2  A: 

The current directory is available in the pseudo-variable %cd%. So:

set X=%cd%

stores it in a variable named X.

Ben M