Figured it out.
WinSCP was using a pre-defined connection instead of the info passed in the script, and the pre-defined connection happened to be sitting in the directory I was CDing to.
Deleted the pre-defined connection and it's all back to normal.
What a mess. I'm going to use a different solution.
WinSCP was using a pre-defined connection instead of the info passed in the script, and the pre-defined connection happened to be sitting in the directory I was CDing to.
Deleted the pre-defined connection and it's all back to normal.
What a mess. I'm going to use a different solution.