Paul Emmons
2005-07-16 12:37:21 UTC
This demonstration script is not yet successful.
I would like to get the long name from the short name of a file (in
this case, given as a command-line argument).
I was hoping that either the name or the path property of the file
object would do it, but no joy. The name property = the same short
name given. The path property (default) also just gives the short name
after the subdirectory. There is no "longname" property.
So how is it done?
----------------------------------------------
dim oArgs, oFi, oFS
set oArgs = Wscript.Arguments
if oArgs.count=0 then
wscript.echo "No argument given"
wscript.quit
end if
set oFS = CreateObject("Scripting.FileSystemObject")
set oFi = oFS.GetFile(oArgs.item(0))
wscript.echo oFi.name
wscript.echo oFi
I would like to get the long name from the short name of a file (in
this case, given as a command-line argument).
I was hoping that either the name or the path property of the file
object would do it, but no joy. The name property = the same short
name given. The path property (default) also just gives the short name
after the subdirectory. There is no "longname" property.
So how is it done?
----------------------------------------------
dim oArgs, oFi, oFS
set oArgs = Wscript.Arguments
if oArgs.count=0 then
wscript.echo "No argument given"
wscript.quit
end if
set oFS = CreateObject("Scripting.FileSystemObject")
set oFi = oFS.GetFile(oArgs.item(0))
wscript.echo oFi.name
wscript.echo oFi