Link to home
Start Free TrialLog in
Avatar of nathanlukewong
nathanlukewong

asked on

vbscript get file extension

Hi guys was wondering if anyone knew why i cant get this code to run?
Cheers
Nathan
Set objFSO = CreateObject("Scripting.FileSystemObject")
objStartFolder = "D:\"
 
Set objFolder = objFSO.GetFolder(objStartFolder)
Set objExtension = objFSO.GetExtensionName("D:/") 
Set colFiles = objFolder.Files
For Each objFile in colFiles
	If objExtension = "jpeg" then
    Wscript.Echo objFile.Name
	End if
Next

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial