Skip to content

Instantly share code, notes, and snippets.

@akirad
Last active November 11, 2017 00:29
Show Gist options
  • Save akirad/041c081b3086c94a3cb1eca657e727a6 to your computer and use it in GitHub Desktop.
Save akirad/041c081b3086c94a3cb1eca657e727a6 to your computer and use it in GitHub Desktop.
A vbs script which lists files in the specified dir.
Option Explicit
Dim objArgs
Set objArgs = WScript.Arguments
If objArgs.Count = 1 Then
Call listFile
End If
Sub listFile()
Dim objFileSys
Dim objDir
Dim objFile
Set objFileSys = CreateObject("Scripting.FileSystemObject")
Set objDir = objFileSys.GetFolder(objArgs(0))
Dim strFile
For Each objFile In objDir.Files
strFile = strFile & objFile.Path & vbCrLf
Next
WScript.Echo(strFile)
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment