Spaces in filenames...

Advertisement

Floatingshed
Guest

Spaces in filenames...

Hello,

I need to occasionally delete a remote file so I've written a simple gui that inserts the filename into a command line and executes it. This is my command line:

"c:\Program Files\winscp\winscp.com" /command "option batch abort" "option confirm off" "open ftp://password:username@server.com" "rm /Temp/File_to_delete.plp" "exit"

It works fine unless the filename has any spaces in it. In that case I get a file not found error, normally this is fixed by putting the whole filename and path in quotes, but it already is!

Any help much appreciated.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,287
Location:
Prague, Czechia

Re: Spaces in filenames...

See
https://winscp.net/eng/docs/commandline#syntax

I.e. the correct syntax is:

"c:\Program Files\winscp\winscp.com" /command "option batch abort" "option confirm off" "open ftp://password:username@server.com" "rm ""/Temp/File_to_delete.plp""" "exit"

_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum