Re: forfile with winscp not working-Need to put folder of files
You have quotes all wrong.
But actually I was not able to make
Another issue that the
Even such a trivial command like this does not work:
One have to run the command via
So my final solution was:
But ANYWAY!
Why are you using
But actually I was not able to make
foreach
refer to winscp.com in path with spaces.
Another issue that the
foreach
is broken when passing arguments to the command.
Even such a trivial command like this does not work:
forfiles /m *.csv /c "notepad.exe @file"
One have to run the command via
cmd.exe
to make it work properly.
So my final solution was:
FORFILES /m *.csv /c "cmd.exe /c c:\progra~2\winscp\WinSCP.com /command \"option confirm off\" \"option batch abort\" \"open Transfer\" \"put \"\"@file\"\"\" \"exit\""
But ANYWAY!
Why are you using
foreach
at all? WinSCP supports file masks too:
"C:\Program Files (x86)\WinSCP\WinSCP.com" /command "option confirm off" "option batch abort" "open "Transfer" "put ""c:\Files\*.csv""" "exit"