Re: How to get long filename from short filename?
- From: "Andreas Kaestner" <andreaskaestner@xxxxxx>
- Date: Sun, 17 Jul 2005 02:46:17 +0200
Paul Emmons (pemmons@xxxxxxxxxxxx) schrieb/wrote:
> Function LongName(ShortName)
> dim oFS, oFI
> set oFS = CreateObject("Scripting.FileSystemObject")
> set oFi = oFS.GetFile(ShortName)
> With CreateObject("Wscript.Shell")
> With .CreateShortcut("dummy.lnk")
> .TargetPath = oFi
> LongName = .TargetPath
> End with
> End with
> set oFS = nothing
> set oFi = nothing
> End Function
A bit more compact (Const used to avoid long lines):
' returns long path/filename from any filename (long or short)
' regardless whether path is given or missing
'
Function LongName(strFName)
Const ScFSO = "Scripting.FileSystemObject"
Const WScSh = "WScript.Shell"
With WScript.CreateObject(WScSh).CreateShortcut("dummy.lnk")
.TargetPath = CreateObject(ScFSO).GetFile(strFName)
LongName = .TargetPath
End With
End Function
--
Gruß, | Bitte in der NG antworten | Win98-Tipps:
Regards, Andreas | Please reply to the NG | http://a-kaestner.de
==================*===========================*=======================72
OE-QuoteFix 1.19.2: http://home.in.tum.de/~jain/software/oe-quotefix/
.
- References:
- How to get long filename from short filename?
- From: Paul Emmons
- Re: How to get long filename from short filename?
- From: y sakuda
- Re: How to get long filename from short filename?
- From: Paul Emmons
- How to get long filename from short filename?
- Prev by Date: Re: Drive Map Script not Reading User Groups
- Next by Date: Re: Change permission remotely
- Previous by thread: Re: How to get long filename from short filename?
- Next by thread: Re: How to get long filename from short filename?
- Index(es):