7

Possible Duplicate:
Get current folder name by a DOS command?

In my batch file, I have,

SET currentFolder=%CD%
echo "%currentFolder%"

Prints the whole directory path.

C:\www\scritps\

I need to get scripts alone

Raj
  • 503
  • 4
  • 9
  • 16

1 Answers1

8

There really isn't an easy way to do it. This works in a .bat file:

for %%* in (.) do @echo %%~n*
Aaron
  • 770