Question:

How can I get the filename from a full path in a batch file?

by  |  earlier

0 LIKES UnLike

I'm trying to write a batch file which can extract the path and file name from a full path, and set these into variables in the batch file.

For example, if the argument is c:\temp\dir1\file1.txt, I want to set filename = file1.txt, and path=\temp\dir1\

 Tags:

   Report

1 ANSWERS


  1. If you're talking about a DOS .bat file, I don't think there is a way. DOS batch files have the least power and capability of any shell language I've ever used.

    Sorry.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.