It's not a runtime issue. Basically visual basic can only create one folder at a time. So if it tries to create folder transfers/f1, and transfers doesn't already exist, it crashes. So I replaced code like that with a call to md on the command line. The -p is an argument I was trying to pass to mkdir to tell it to "also create all directories leading up to the given directory that do not exist already. If the given directory already exists, ignore the error.". But I'm thinking that might be a unix only argument and on windows you don't need the -p at all. It's getting interpreted as a folder to create instead.