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.
May 14, 2006
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
You May Also Like