Tech Support > Microsoft Windows > Can I access the file name selected by explorer
Can I access the file name selected by explorer
Posted by David Peters on April 7th, 2006


I am writing some code and I would like to know what the file name is
that I have got highlighted by explorer.


(The next step for my code is to detect if certain characters appear
in the name. If those characters do appear then I want to interrupt
the DELETE operation initiated by pressing the DEL key.]


Is there a variable which can provide this information?

The closest I have come to is "%L" (without the quotes) which
provides the full path name and the file name. However, I want just
the file name and, ideally, not even the extension.