Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


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.

Get Problem - wrong path


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\" /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
mget PL*.BNN
mget PLU0*.BNN
rm PL*.BNN
rm PLU0*.BNN

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?