Topic "drag-drop onto batch file"

Author Message
BGM

Guest


Hello, y'all!
I have a batch file that runs a script. I want to drag a file onto the batch file's icon in order to upload it to the server. My script works fine if I send a parameter by commandline, say
ftp.bat "myfile.html"
but it doesn't work if I drag a file onto the batch icon.

Here is the contents of my batch file:
winscp.com /script="ftpdrop.txt" /parameter %1

in my script, I have simply:
open user:pasword@myftpsite:21
put %1%
close
exit
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Try enclosing the %1% into double-quotes. It is needed, if the path your drop on the .bat file has spaces in it.

Quote:
put "%1%"

_________________
Martin Prikryl
Guest




Thanks, I actually tried that but it didn't make the difference. However, I did add that to the script nonetheless, but what DID fix it was that in my batchfile, I had to enclose the full path to the script. I assumed the batch file would look in its own folder for the script. Anyway, thanks for your help.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License