Topic "drag-drop onto batch file"

Author Message


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: /script="ftpdrop.txt" /parameter %1

in my script, I have simply:
open user:pasword@myftpsite:21
put %1%
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
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.

put "%1%"

Martin Prikryl

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.

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License