I am using c#.NET 2.0 to execute DOS commands to ftp a file. All works except for 1 thing, in the cmd file I call, it runs a PUT statement. Right now the put statement has a hardcoded local file path. I need to specify a dynamic path. I've tried
put %~dp0\myfile.DTL myfile.dtl
but it says it can't find the file.
Right now the .NET code calls a BAT file which only exist to call the CMD file. Interestingly, the BAT file DOES successfully use a relative path in its call to the CMD file:
ftp.exe -s:%~dp0\oit.cmd
However, I can't get that relative path to wrok in the cmd file:
open <my host>
<user name>
<password>
put <hardcoded path that needs to be relative path>localfilename remotefilename
I'll bever know where it will exist so I just need to grab whatever local directorey the file is in.