Last active
November 11, 2017 00:29
-
-
Save akirad/041c081b3086c94a3cb1eca657e727a6 to your computer and use it in GitHub Desktop.
A vbs script which lists files in the specified dir.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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