@echo off if not "%1"=="" goto MAIN :HELP echo Drag a Windows 95 file and drop it on this batch file echo to see what can be done with the filename. goto DONE :MAIN rem the next line changes to the drive of the argument %1\ rem the next line changes to the directory of the argument cd %1\.. echo The argument to this batch file: echo %1 echo. pause cls echo Short directory name (output of TRUENAME): truename | find ":" echo. pause cls echo Short file name root (searched output of DIR command): dir %1 | find "-" | find ":">en#er.bat fc en#er.bat nul /lb1 /n |date|find " 1: ">en#er.bat echo echo %%5>enter.bat call en#er.bat del en?er.bat>nul echo. pause cls echo Short file name extension (searched output of DIR command): dir %1 | find "-" | find ":">en#er.bat fc en#er.bat nul /lb1 /n |date|find " 1: ">en#er.bat echo echo %%6>enter.bat call en#er.bat del en?er.bat>nul echo. pause cls echo Long directory name (output of CD): cd echo. pause cls echo Long file name (output of DIR /B): dir /b %1 echo. pause cls echo Long fully-qualified file name (output of DIR /S /B): dir /s /b %1 echo. pause cls echo Short file name (output of FOR with LFNFOR OFF) lfnfor off for %%x in (%1*) do echo %%x echo. pause cls echo Long file name (output of FOR with LFNFOR ON) lfnfor on for %%x in (%1*) do echo %%x echo. pause cls echo Just the drive letter (Error message from MODE) mode %1> #nval#d.bat echo echo %%3 >invalid.bat call #nval#d.bat del ?nval?d.bat >nul echo. pause :DONE :: http://www.ericphelps.com rem following code insures this window will close when done @echo off cls exit