I was curious what file extensions might already be setup in the registry so wrote the below PowerShell script to display the PerceivedType for the various HKEY_CLASSES_ROOT.xxx
# PowerShell script by Carl Barnes
# View Registry Explorer Preview "PerceivedType" for Clarion Extensions (.clw .inc ... etc)
# to have an idea if they already have a "PerceivedType" defined that is not "text"
#-----------------------------------------------------------------------------------------
# Save this with the PowerShell extension .PS1" e.g. "ExplorerPreviewClarion-View.PS1"
# In Windows Explorer right-click and select "Run with PowerShell"
#-----------------------------------------------------------------------------------------
function See-PerceivedType {
Param( [string] $DotExten )
ECHO "========================================================================"
try
{
# Get-ItemProperty -path "Registry::HKEY_CLASSES_ROOT\$DotExten" -Name PerceivedType
$PType = (get-itemproperty -path "Registry::HKEY_CLASSES_ROOT\$DotExten" -Name PerceivedType)
ECHO ($DotExten + " -- See PerceivedType -- " + $DotExten + " --" )
ECHO $PType
}
catch [System.Management.Automation.PSArgumentException]
{ ECHO ($DotExten + " -- Error: Value PerceivedType does NOT exist for CLASSES_ROOT\" + $DotExten ) }
catch [System.Management.Automation.ItemNotFoundException]
{ ECHO ($DotExten + " -- Error: Registry does NOT have Key CLASSES_ROOT\" + $DotExten ) }
catch
{ ECHO ($DotExten + " -- Error: Get-ItemProperty failed for CLASSES_ROOT\" + $DotExten + " " + $Error[0] ) }
}
##################### End See-PerceivedType #####################
$ErrorActionPreference = "stop" #so Try/Catch works, alternate is parm: -ErrorAction Stop
See-PerceivedType '.clw' # Clarion Source CLW
See-PerceivedType '.inc' # Clarion Include, already Text on mine
See-PerceivedType '.int' # Clarion Interface
See-PerceivedType '.equ' # Clarion Equates
See-PerceivedType '.trn' # Clarion Translate
See-PerceivedType '.sln' # VS Solution, not that useful
See-PerceivedType '.cwproj' # Clarion Project
See-PerceivedType '.txa' # Clarion APP Export
See-PerceivedType '.apv' # Clarion APP Version Control
See-PerceivedType '.tpl' # Clarion Template
See-PerceivedType '.tpw' # Clarion Template
See-PerceivedType '.c' # .C files was defined as Text on my machine
# See-PerceivedType '.ps1' # PowerShell scripts not defined but are text
# See-PerceivedType '.sql' # .SQL files should be defined as Text
# See-PerceivedType '.a' # .A has Key but no PerceivedType so tests Catch PSArgumentException
ECHO "========================================================================"
pause
exit
This code needs to have a .PS1 file extension, the right-click and choose “Run with PowerShell”
Here’s what it looks like when it runs. On my PC the .INC was already setup as Text.
PS1 is in attached Zip
Preview_Clarion_Source.zip (1.3 KB)
Preview_Clarion_Source_Version2.zip (1.6 KB)