Long Filename To Short

Converts filenames in order to take less storage in the FAT

This script converts recursively long filenames to short one where it is possible, without altering programs.
In fact, when a filename is in format 8.3 and not in uppercase, the name is handled as a LFN, wasting space in the FAT.
With this script, you spare space, but warning, it is a little long to execute.

File Name : longfn2short.vbs
Requirement : A disk in FAT, not in NTFS
Author : Jean-Luc Antoine
Submitted : 01/09/2001
Category : Other
Dim A,B,C,D,E,G,i
On Error Resume Next
Function Recurs(ByVal p)
    Dim f, k, s, t
    Set f = i.GetFolder(p)
    For Each k in f.subFolders
     e = e + 1
     s = s & Recurs(k)
     t = k.ShortName
     If k.name <> t then
      If uCase(k.name)=uCase(t) Then
          i.MoveFolder k, i.BuildPath(p,t) 
          a = a + 1
      Else
          s = s & "Fld:" & k.name & vbCrLf
          b = b + 1
      End If
     End If
    Next
    For Each k in f.Files
     e = e + 1
     t = k.ShortName
     If k.name <> t then
      if uCase(k.name)=uCase(t) Then
          i.MoveFile k, i.BuildPath(p, t)
          c = c + 1
      Else
          s = s & "File:" & k.name & vbCrLf
          d = d + 1
      End If
     End If
    Next
    Recurs = s
End Function

If 1=MsgBox("This script converts long filenames and foldernames to short one " & _
	"in order to need less storage in the FAT.",1) Then
    G = InPutBox("Enter the parent directory to convert", "(c) 1998 JLA", "c:\program files")
    If G <> "" Then
     A=0
     B=0
     C=0
     D=0
     E=0
     Set i = CreateObject("Scripting.FileSystemObject")
     MsgBox "Files and directories that can't be shorten:" & vbCrLf & Recurs(G)
     MsgBox "Result for " & E & " items scanned:" & vbCrLf & A & " renamed folders" & _
		vbCrLf & B & " folders that can't be renamed" & vbCrLf & C & _
		" files renamed" & vbCrLf & D & " files that can't be renamed"
    End If
End If
Server Info
Remote Info
Compress

Batchs
BootSector
Droit
Accessoire GFA
On Now
Ecran plasma
Système d'exploitation
Son
Unités
Scripting
Multilingue
Site Web
Bruit et son
Architecture Google


4K
Color picker
TaskList
Backup files
Mini Port Scanner
Website To CHM
PixyDemo
Web password recovery
4KWebServer
Kill Popup
VBE decoder
Script Optimizer
Database Password Recovery
Class
Ini
EMail validator
Graphical Class
MP3 Info
Pinger Class
IP ranger class
SoftwareMetering
Path Validator
Time Stamper Class
LoggerCLS
HTA
Keyword Ranking
DOM Explorer
HTA-Notepad
PixyPortManager
Other
flashMessage
Kill Popup
VBE decoder (fixed)
Error Codes
Maze generator
Char counter
HTML To Word
ICQ Choose User
ScreenSaver Password decoder
Mp3Playlister - singleList
Long Filename To Short
Trace Math
Dump Hexa File
Self modifying script
Mp3Playlister - multiList
HTANoid
PixyWebServer
Python
Progress indication

©2002 Jean-Luc Antoine. All Rights Reserved. Scripts or any other material on this website may not be redistributed or put as part of ANY collection (script archives, CDs etc) without prior written permission. Permission granted to use and modify any of the scripts found on InterClasse.com