drag-drop onto batch file

Advertisement

BGM
Guest

drag-drop onto batch file

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: drag-drop onto batch file

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%"

Reply with quote

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.

Reply with quote

Advertisement

You can post new topics in this forum