Get Problem - wrong path

Advertisement

Nordmann666
Guest

Get Problem - wrong path

Hello,

i got this problem with my script:

i call a cmd-file that calls another cmd-file to get files from FTP

First file: BNN.cmd
SET lieferdev=d:
SET BNNDIR=%lieferdev%\transfer\batch\ftp
SET LOG_DATEI_CEXT=%bestelldev%\transfer\batch\ftp\bnn.log
if exist %BNNDIR%\BNN_xxx.cmd call %BNNDIR%\BNN_xxx.cmd


Second file: BNN_xxx.cmd
SET lieferdev=d:
SET lieferdir=%lieferdev%\transfer\batch\ftp
SET orderdir=%lieferdev%\transfer\dfue\import
SET xxxdir=%orderdir%\xxx
IF NOT EXIST %xxxdir% MKDIR %xxxndir%
SET xxxbck=%xxxdir%\backup
SET xxxlog=xxxlog.txt
SET xxxfile=d:\transfer\batch\ftp\BNN_xxx.txt
"d:\transfer\batch\Winscp\winscp.com" /script=d:\transfer\batch\ftp\BNN_xxx.txt
if not exist d:\transfer\batch\ftp\PL*.* goto ENDE
COPY d:\transfer\batch\ftp\PL*.* d:\transfer\DFUE\Import\xxx\*.*


Third file: BNN_xxx.txt
open ftp://USERNAME:PASSWORT@FTP-Adress
bin
mget PL*.BNN
mget PLU0*.BNN
rm PL*.BNN
rm PLU0*.BNN
bye




the problem is that the files i download from the ftp will be saved at d:\transfer if i start bnn.cmd.
AND the files saved in d:\transfer\batch\ftp if i start bnn_xxx.cmd.

Why the files stored in different path?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,517
Location:
Prague, Czechia

Re: Get Problem - wrong path

As you do not specify a target path in WinSCP script, nor you set a current working directory in your batch files (nor the WinSCP script), the files are downloaded to the current working directory.

If you execute the batch file from Windows Explorer, the current working directory will, by default, be the directory, where the batch file is stored.

Reply with quote

Advertisement

You can post new topics in this forum