CMD: Find Filename from %1 in batch-file

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

Moderators: XnTriq, xnview

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

CMD: Find Filename from %1 in batch-file

Post by Peter2 » Wed Sep 30, 2009 10:14 am

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
XnView 2.48 German, Win 7 x64 Prof. / Win 10

User avatar
XnTriq
Moderator & Librarian
Posts: 5447
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

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

Post by XnTriq » Thu Mar 04, 2010 2:30 am


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

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

Post by Peter2 » Thu Mar 04, 2010 6:04 am

Thanks XnTriq

I will take a look.

Peter
XnView 2.48 German, Win 7 x64 Prof. / Win 10

Post Reply