base name variable in VBScript?
Posted: 10 Mar 2018 11:40
how to send base name of selected file to the following VBScript
may help:
Code: Select all
CreateObject("WScript.Shell").Run("""http://www.google.com/search?q="base name"" ")
Code: Select all
option explicit
Dim strFile, FSO, oFile
If WScript.Arguments.Count > 0 Then
strFile = WScript.Arguments.Item(0)
End If
Set FSO = CreateObject("Scripting.FileSystemObject")
Wscript.Echo "FSO 'path' methods" & vbNewLine & "---------------------" _
& vbNewLine & "GetBaseName: " & FSO.GetBaseName( strFile) _
Set FSO = Nothing
Wscript.Quit