Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem: I want to get the filename only from this path line in Command Prompt

Here's my path:


What kind of command should I do?

I already tried this solution How to get filename only without path in windows command line?

but it didn't work...

share|improve this question
Please describe exactly what you tried. – Scott Mar 14 '13 at 4:54
up vote 1 down vote accepted

Dir /b \\jktfile-01\lsmk\SRP\BankPelapor\201209\Instance\*.xml

will output


along with all other .xml files.

Not 100% sure what you are asking for though.

share|improve this answer
I believe the OP is looking for dir /b \\jktfile-01\lsmk\SRP\BankPelapor\201209\Instance\2882000-2012-09-30-BSMS26.xml, which will output just 2882000-2012-09-30-BSMS26.xml. – Scott Mar 14 '13 at 5:53
@Scott Yep i want to get the file name from the line of link that i got, thx – Sabilv Mar 14 '13 at 7:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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