Hoping somebody can help me. Feel like this should be really simple but cant understand why it wont work. Im trying to loop a folder and open each file. If i hardcode the filename into the command it will open but if i try to pass the filename, it says it cant find the file.
Set objFSO = Createobject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\temp\FCW")
For Each objFile in objFolder.Files
If LCase(Right(objFile.Path, 4)) = ".fcw" Then
'CreateObject("WScript.Shell").Run("""C:\Temp\FCW\FCW Converted.fcw""")
CreateObject("WScript.Shell").Run(objFile.Path)
End If
Next
Top line within the If statement works and opens the doc but ive tried everything i can think of to pass the name of the file from the loop and cant get it to work. Any ideas what im doing wrong? (havent included all the other commands ive tried just used objFile.Path as an example to keep code down)