Ho risolto in parte il problema:

sub tb64(dirf)
set file = fso.getfile(dirf)
set leggi = file.openastextstream(1)
set scrivi = fso.createtextfile("C:\file.txt")

for a = 1 to fix(file.size / 3)
cod = ""
for b = 1 to 3
tmp = dtb(asc(leggi.read(1)))
cod = cod & String(8 - len(tmp), "0") & tmp
next
for b = 0 to 18 step + 6 ' ERA QUI L'ERRORE... 18 NON 24 PERCHE PARTO DA 0
tr btd(mid(cod, b+1, 6))


Ora il messaggio che mi viene fuori è
R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAR

mentre quello che mi dovrebbe venire è
R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==


Evidentemente c'è qualcosa che non va in quel select case alla fine della sub tb64