Long filename conversion

  • Thread starter Jens Mose Pedersen
  • 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.
 
J

Jerold Schulman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top