Several people seem to complain about the official tool to fix the "Why my motor does not move" problem. Well, me too.
Obviously the simple problem is that EleksCAM does not like comma as the decimal sign (it only accepts point). While this should be easy to fix in the software itself, we have to live with workarounds.
To not depend on the official workaround, I created a powershell script (designed for use within Windows 10, no guarantee whatsoever), which will only change the decimal sign to point - not the full locale settings.
I use it before I start EleksCam, and then again to set back to comma after I finished work with EleksCam.
You may also adapt the script to do this job automatically as a wrapper of EleksCam.
Unfortunately, I "do not have privileges" to add any images or files here, so you have to copy&paste yourself. There isn't even any formatting option for code in this editor. Anyway...
There is the script itself (ending with .ps1) and there is a link to powershell to execute this file with required parameters.
You should create the file SwitchDecSign.ps1 with the following content:
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") > $null
$CurrentDecSign = Get-ItemProperty -path 'Registry::HKEY_CURRENT_USER\Control Panel\International' -name 'sDecimal'
$CurrentDecSign = $CurrentDecSign.sDecimal
if ($CurrentDecSign -eq ","){
$CurrentName = "comma"
$SwitchDecSign = "."
$SwitchName = "point"
}
elseif ($CurrentDecSign -eq "."){
$CurrentName = "point"
$SwitchDecSign = ","
$SwitchName = "comma"
}
else{
write-host "Unknown decimal sign " $CurrentDecSign
exit
}
$Question = "Current decimal sign is " + $CurrentName + ".`nSwitch to " + $SwitchName + "?"
$Result = [System.Windows.Forms.MessageBox]::Show(
$Question,
"Decimal Sign Switcher",
[System.Windows.Forms.MessageBoxButtons]::OKCancel,
[System.Windows.Forms.MessageBoxIcon]::Question
)
$global:balmsg = New-Object System.Windows.Forms.NotifyIcon
$path = (Get-Process -id $pid).Path
$balmsg.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path)
$balmsg.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Info
switch ($Result){
"OK" {
Set-Itemproperty -path "HKCU:\Control Panel\International" -name "sDecimal" -value $SwitchDecSign
write-host "Decimal sign has been changed to " $SwitchName
$balmsg.BalloonTipTitle = "Decimal sign has been changed"
$balmsg.BalloonTipText = "Decimal sign for user $Env:USERNAME is now $SwitchName"
}
"Cancel" {
write-host "Nothing has changed"
$balmsg.BalloonTipTitle = "Decimal sign remains unchanged"
$balmsg.BalloonTipText = "Decimal sign for user $Env:USERNAME remains $CurrentName"
}
}
$balmsg.Visible = $true
$balmsg.ShowBalloonTip(6000)
Start-Sleep -s 3
Then you should create the shortcut link to the .ps1 file as:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noLogo -ExecutionPolicy unrestricted -file "C:<your path to>\SwitchDecSign.ps1"
You can check the content of the .ps1 to ensure it's not a virus or does bad things.
Maybe you prefer to use this script instead of the official Fix Tool.
Cheers,
Martin