I've been racking my brain trying to get my softphone to dial numbers on web pages. I've gotten the browser to pass the number through to the softphone, but it adds tell:+ to the number and won't call out.

As a matter of last resort, I want to create a batch file to remove the tel:+ from the number. I have never written one before, but I imagine that it would be relatively simple.

The batch file just needs to open the tel: urls and remove tell:+ from the number before passing it on to the softphone.

I would really appreciate it if someone could point me in the right direction.

link|improve this question

Would that be a Windows batch file? – sendmoreinfo Feb 12 at 20:33
feedback

1 Answer

If this is a Windows batch file, the following will get you moving:

Num.cmd:

set num=tel+:9165551212
@echo Your number is %num:~5,10%

You have a straightforward, but limited, ability to extract or parse information from an environment string in Windows batch.

An explanation can be found at the dos command prompt - remember that the path variable is also just another environment variable:

Set /?

...snip...

May also specify substrings for an expansion.

%PATH:~10,5%

would expand the PATH environment variable, and then use only the 5 characters that begin at the 11th (offset 10) character of the expanded result. If the length is not specified, then it defaults to the remainder of the variable value. If either number (offset or length) is negative, then the number used is the length of the environment variable value added to the offset or length specified.

%PATH:~-10%

would extract the last 10 characters of the PATH variable.

%PATH:~0,-2%

would extract all but the last 2 characters of the PATH variable. ...snip...

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.