I have the following code I am trying to execute. If I debug.print sCommand I can copy and paste it in a cmd window and it will execute. But it will not work in VBA unless I take out the >\\.....\log.txt portion. It's like trying to make a log file breaks it. Can someone help me figure out what i'm doing wrong here?
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("\\server\folder1\folder2\folder3\ftpscript.txt", True)
a.writeline "test" 'username
a.writeline "test123" 'password
a.writeline "put " & Chr(34) & sfile & Chr(34)
a.writeline "quit"
a.Close
sCommand = "ftp -i -s:" & Chr(34) & "\\server\folder1\folder2\folder3\ftpscript.txt" & Chr(34) & " ftp.xsite.com > " & Chr(34) & "\\server\folder1\folder2\folder3\LOG.TXT" & Chr(34)
Shell sCommand, vbMaximizedFocus
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("\\server\folder1\folder2\folder3\ftpscript.txt", True)
a.writeline "test" 'username
a.writeline "test123" 'password
a.writeline "put " & Chr(34) & sfile & Chr(34)
a.writeline "quit"
a.Close
sCommand = "ftp -i -s:" & Chr(34) & "\\server\folder1\folder2\folder3\ftpscript.txt" & Chr(34) & " ftp.xsite.com > " & Chr(34) & "\\server\folder1\folder2\folder3\LOG.TXT" & Chr(34)
Shell sCommand, vbMaximizedFocus