registry - regedit and remove first part of string passed through to exe -


i have simple dialler programme trying associate tel & callto html tags when associate via registry:

[hkey_current_user\software\classes\callto\shell\open\command] "c:\program files (x86)\mitel\unified communicator advanced 5.1\ucadialer.exe" "%1" 

it passes thorough information tag, ie:

callto:07777123456 

what results in dialler programme using following string:

922558607777123456 

which after confusion turned out numbers on keys c l l t o.

what therefore need trigger dialler pass through info after colon, missing letters of callto or tel.

can done changing registry string? if not, there workaround?

many in advance.

i couldn't figure out how in registry string, ended writing powershell script , calling instead of ucadialer.exe.

here's put hkcu\software\classes\callto\shell\open\command\(default):

"c:\windows\system32\windowspowershell\v1.0\powershell.exe" -file "c:\programmes\click2call.ps1" "%1" 

then made new text file in c:\programmes , named click2call.ps1 these contents (see below). see comments on right side details.

$thingclicked=$args[0]           #saves thing clicked on $thingclicked (passed in through "%1" in registry string) $outsidelineprefix="8"           #in case have dial number outside line. have dial 8 $countrycode="1"                 #in case have dial country code. our links don't have country code  #put path ucadialer.exe in row below: $pathtoucadialer="c:\program files (x86)\mitel\unified communicator advanced 6.0\ucadialer.exe"  function dialwithuca($rawnumber) #defines dialwithuca function next 5 rows:     {     $numeralsonly=$rawnumber -replace "\d"                             #removes in $rawnumber isn't numeral     $numbertodial=$outsidelineprefix + $countrycode + $numeralsonly    #here, can remove $outsidelineprefix and/or $countrycode here if don't need them     & $pathtoucadialer $numbertodial                                   #launches ucadialer.exe , feeds phone number dial     } dialwithuca($thingclicked)                                             #runs dialwithuca function on thing clicked. 

the script takes whatever clicked, strips out isn't numeral, appends 81 beginning, , sends ucadialer.exe. can remove $outsidelineprefix + $countrycode + in row 11 if don't need 81.

this script work on links without country code. add more logic format string correctly; example, tel links have "1" @ beginning, others not. haven't figured out how yet, this blog post looks promising.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -