How do I dynamically specify a file in DOS?

Posted by donde on Stack Overflow See other posts from Stack Overflow or by donde
Published on 2010-06-01T20:20:17Z Indexed on 2010/06/01 20:23 UTC
Read the original article Hit count: 242

Filed under:
|

I am trying to use c# in .net to run dos commands to ftp a a file. Technically, it calls a BAT file which calls a CMD file which executes the DOS code. It was up to the CMD file. The CMD fiel will work if I hardcode the path, but I need to dynamically specify the path of the file.

BAT File...

ftp.exe -s:%~dp0\mycmdfile.cmd

And in the cmd file...

open <my ost>
<my user name>
<my pw>
quote site cyl pri=1 sec=1 lrecl=1786 blksize=0 recfm=fb retpd=30
put <here is where I need the dynamic path> + localfilename remotefilename

quit

© Stack Overflow or respective owner

Related posts about ftp

Related posts about dos