How to remove prefixes in strings on Windows command line?

You could use the string replace function of batch

pushd %programfiles%
set "prefix=%programfiles%"
setlocal DisableDelayedExpansion
for /r . %i in (*.exe) do (
  set "progPath=%~i"
  setlocal EnableDelayedExpansion
  set "progPath=!progPath:%prefix%=!"
  echo !progPath!
  endlocal
)
popd

Put this in a batch file and run, it should do the job.

@echo off
setlocal ENABLEDELAYEDEXPANSION
cd %programfiles%
for /r . %%i in (*.exe) do (
    set pth=%%~fi
    set val=!pth:%cd%\=!
    echo !val!
)