I know there are a few answers to this already but I am unsure why the answers are not working. I will list what I have done.
Basically I want to log information from a shell.Run command into a log file.
What I have
Dim WshShell
Dim WshProcEnv
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run """C:\Program Files\Folder\batchFile.bat""", 1, TRUE
Which successfully runs the batch file.
So looking at answers like this one I have tried the following:
WshShell.Run "cmd /c C:\Program Files\Folder\batchFile.bat > C:\Program Files\Folder\log.txt", 1, TRUE
WshShell.Run "cmd /c ""C:\Program Files\Folder\batchFile.bat > C:\Program Files\Folder\log.txt""", 1, TRUE
WshShell.Run """cmd.exe /c ""C:\Program Files\Folder\batchFile.bat > C:\Program Files\Folder\log.txt""", 1, TRUE
I believe it's something small hence why I've asked a new question.