How to check if current filename is a file or a directory?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
PiotrMPPL
Junior Member
Junior Member
Posts: 60
Joined: 2018-10-26, 07:04 UTC

How to check if current filename is a file or a directory?

Post by *PiotrMPPL »

How to check if current filename is a file or a directory?

Folder name - Test.ab.cd

%O.%E return folder name - Test.ab
User avatar
petermad
Power Member
Power Member
Posts: 16118
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to check if current filename is a file or a directory?

Post by *petermad »

You can use this Button to test

Code: Select all

TOTALCMD#BAR#DATA
%COMSPEC% /K
if exist %P%N\* (echo FOLDER) else echo FILE
%COMMANDER_EXE%,2
Test for folder or file


-1
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply