{sourcepath} passes the path with the trailing double quotes

Like the title says, I have this command on a button, eg:

"C:\Scripts\testscript.exe" {sourcepath}

And if there are no spaces in the folder path, it works ok, but if there is any spaces in the folder path, the string is passed on with a single trailing double qoutes at the end, like so:

D:\test\New Folder"

Or rather one extra double qoute at the end maybe? Is this a bug or am I missing something?

Try {sourcepath|noterm}

What you're seeing is probably from a program using the Microsoft C runtime to interpret the command line, which turns \" at the end of the string into a literal ". Adding the "noterm" suppresses that \ at the end.

@leo, thank You, it works.

I used in a c# console app.