Long filename conversion

  • Thread starter Thread starter Jens Mose Pedersen
  • Start date Start date
J

Jens Mose Pedersen

Is there a tool for converting a long filename to a short
8.3 filename?
Some other tools I use will not accept filenames with spaces.
 
Is there a tool for converting a long filename to a short
8.3 filename?
Some other tools I use will not accept filenames with spaces.


See tip 494 in the 'Tips & Tricks' at http://www.jsiinc.com


Here is MakeShort.bat that you can call:

@echo off
if {%2}=={} @echo Syntax MakeShort FileName ShortName&goto :EOF
if not exist %1 @echo Syntax MakeShort FileName ShortName - %1 not found.&goto
:EOF
setlocal ENABLEEXTENSIONS
set shortname=%~sn1%~sx1
endlocal&set %2=%shortname%


Usage:

call makeshort "c:\Documents and Settings\username\this has spaces.txt shortname
@echo %shortname%


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Back
Top