Friday, April 03, 2009

Nice little VBScript trick

To go from a path like this

to a path like this

you can do this
sFile = "D:\_pdf\a\b\c\"
sResult = Join(Split(sFile, "_pdf\",-1,1),"")

I just thought I'd share.

1 comment:

John said...

Works great, unless you're using UniCode based folder names on a 64-bit from certain foreign machines >.<

I'll have to see if there's a UniCode version of split that defines multiple separate characters.. tried it to remove my folder:


it ripped it up =/