JSI Tip 10487. How can a Vbscript determine the drive/folder path of a Fully Qualified File Name argument?

Jerold Schulman

May 14, 2006

1 Min Read
ITPro Today logo in a gray background | ITPro Today


The following scriptlet demonstrates how you can extract the drive/folder path of a Fully Qualified File Name argument:

Dim objArgsSet objArgs = Wscript.Argumentsif objArgs.Count  1 then  Wscript.Echo  "FQFN is required" WScript.Quit (1)End IfFQFN = objArgs(0)fName = mid(FQFN, instrrev(FQFN, "") + 1) ' Determine file name pName = Mid(FQFN, 1, (Len(FQFN) - Len(fName) - 1)) ' Determine number of characters in drive/folder pathwscript.echo pName



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like