#152309 - 2005-11-26 04:02 AM
Set Calculator View mode
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11629
Loc: CA
Was messing around with some other stuff and ran into Calc not being set in the registry as I thought, so whipped up a small script to set it. Should work both locally and remotely if you have Admin rights. Requires KiXtart 4.23 or newer. Break On Dim $SO $SO =SetOption ('Explicit' ,'On' )$SO =SetOption ('NoVarsInStrings' ,'On' )$SO =SetOption ('NoMacrosInStrings' ,'On' ) Dim $Calc $Calc = SetCalculator (@WKSTA ,0 ,1 );Only reads setting since Report is set to 1 ;If you do not supply a value for $Report then it will change the setting ;0=Scientific 1=Standard 'CALC is set to: ' + $Calc Function SetCalculator($sComputer ,$State ,optional $Report ) Dim $CalcSetting ,$CalcState ,$WinKey ,$WinPath ,$SetState $sComputer =IIf (Not $sComputer ,'' ,'\\' +Join (Split ($sComputer ,'\' ),'' ,3 )+'\' ) $WinKey ='HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion' $WinPath =IIf (Not $sComputer ,ReadValue ($sComputer +$WinKey ,'SystemRoot' ),$sComputer +Left (ReadValue ($sComputer +$WinKey ,'SystemRoot' ),1 )+'$\' +Right (ReadValue ($sComputer +$WinKey ,'SystemRoot' ),-3 )) If Not @ERROR And Not $Report $SetState =WriteProfileString ($WinPath +'\' +'Win.ini' , 'SciCalc' , 'layout' ,$State ) EndIf $CalcSetting = ReadProfileString ($WinPath +'\' +'Win.ini' , 'SciCalc' , 'layout' ) Select Case $CalcSetting =0 $CalcState ='Scientific state' Case $CalcSetting =1 $CalcState ='Standard state' Case 1 $CalcState ='No value setting found - Standard state' EndSelect $SetCalculator =$CalcState EndFunction
Top
Set Calculator View mode
NTDOC
2005-11-26 04:02 AM
Moderator: Glenn Barnas , NTDOC , Arend_ , Jochen , Radimus , Allen , ShaneEP , Ruud van Velsen , Mart
0 registered
and 525 anonymous users online.