Search found 6 matches

by darwin4ever
2021-Aug-24, 12:24 pm
Forum: Windows CMD Shell
Topic: For /f Quotes - Run a program with a long file name.
Replies: 5
Views: 3935

Re: For /f Quotes - Run a program with a long file name.

Simon Sheppard wrote: 2021-Aug-24, 10:16 am So you will need to add "delims=" to remove those defaults and then %%i will contain everything.
Thanks !!!

The combination of your earlier double-quote-suggestion and the "delims=" solved everything.
Great
by darwin4ever
2021-Aug-24, 5:35 am
Forum: Windows CMD Shell
Topic: For /f Quotes - Run a program with a long file name.
Replies: 5
Views: 3935

Re: For /f Quotes - Run a program with a long file name.

No good, the parameter-surrounding quotes aren't passed to the program : --> program executes but only |this| is passed to the program, meaning surrounding quotes are missing
by darwin4ever
2021-Aug-23, 8:12 am
Forum: Windows CMD Shell
Topic: For /f Quotes - Run a program with a long file name.
Replies: 5
Views: 3935

For /f Quotes - Run a program with a long file name.

Hi, I have a program which accepts a string (may have spaces when surrounded by double quotes) as parameter and returns a string (may have spaces) Like this : "My Program Name.exe" "this is a string" and the output might be "string a is this" and that works But if I wan...
by darwin4ever
2021-Aug-23, 7:44 am
Forum: Windows CMD Shell
Topic: Find backward in a variable
Replies: 3
Views: 3322

Re: Find backward in a variable

Thanks ! Works !

I first thought the %~1 would only work on filenames, not URL's, but it does.
So that's great and simple
by darwin4ever
2021-Aug-16, 2:17 pm
Forum: Windows CMD Shell
Topic: Find backward in a variable
Replies: 3
Views: 3322

Re: Find backward in a variable

I found a way to do it, but maybe there is a better solution. In the meanwhile I reverse the URL, then take the part till the first token (dot) and then reverse it again. SET URLNameSource=%1 call :ReverseString %URLNameSource% for /f "tokens=1 delims=." %%i in ("%ReverseOutputString%...
by darwin4ever
2021-Aug-16, 12:50 pm
Forum: Windows CMD Shell
Topic: Find backward in a variable
Replies: 3
Views: 3322

Find backward in a variable

Lets assume a variable contains an URL, something like https://a_site.com/wp-content/uploads/2020.07/image001.jpg I need to extract the image-extension i.e. in this case the ".jpg" Attention - the length or the URL is never the same - the number of "." (dots) in the URL before th...