The closest I can think of is to pull the info from the title of the directory listing. With your example, this line
DIR %0.BAT | FIND "Directory"
will return
Directory of C:\temp
Using the replaceable parameter for the batch file name allows the command to be used in any file without modification. I don't know of any way to parse the result to extract just the directory name, but the output could be sent to a file for further manipulation.