CMD: Find Filename from %1 in batch-file

All non-XnView related: softwares, formats, imaging, photography...

Moderators: XnTriq, helmut, xnview

Post Reply
User avatar
Peter2
XnThusiast
Posts: 1328
Joined: Thu Nov 24, 2005 3:07 pm
Location: CH

CMD: Find Filename from %1 in batch-file

Post by Peter2 »

If have a simple question regarding DOS/CMD commands:

I have a Link in my Windows "Sendto"-folder which is linked to a batch-file. In the batch file is the command

Code: Select all

set PathName=%1
which gives me the whole path like

Code: Select all

c:\test\support\hallo.txt
That is clear.

How to get only the filename?

Code: Select all

set fileName=???
Regards

Peter
XnViewMP 1.6.5 German, XnConvert 1.99, Win 10
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: CMD: Find Filename from %1 in batch-file

Post by XnTriq »

User avatar
Peter2
XnThusiast
Posts: 1328
Joined: Thu Nov 24, 2005 3:07 pm
Location: CH

Re: CMD: Find Filename from %1 in batch-file

Post by Peter2 »

Thanks XnTriq

I will take a look.

Peter
XnViewMP 1.6.5 German, XnConvert 1.99, Win 10
Post Reply