This is great, thank you very much!
Does this work with Sonar Bundles too? .CWBs?
I enhanced it a bit to be more tolerable to special characters and spaces, and finding the correct directory.
It's working now, but taking time... I should have places it closer to my known CW Sonar songs... Got too excited and placed it almost to the root directory of my music drive (20 years of music). I put the "cwp2song right in my "C:/" Put it there and it will work rightaway, otherwise move it to where you like.
Still testing, but here it is...
@echo off
setlocal enabledelayedexpansion
:: --- 1. UPDATE THIS PATH ---
set "converter=C:\cwp2song.exe"
:: --- 2. ENSURE WE ARE IN THE RIGHT DRIVE/FOLDER ---
:: This moves the script's focus to the folder where you saved it
cd /d "%~dp0"
:: Create the Enter-key helper script
echo Set WshShell = WScript.CreateObject("WScript.Shell") > "%temp%\press_ok.vbs"
echo WScript.Sleep 500 >> "%temp%\press_ok.vbs"
echo WshShell.SendKeys "{ENTER}" >> "%temp%\press_ok.vbs"
for /r %%f in (*.cwp) do (
set "oldpath=%%f"
set "filename=%%~nf"
set "folder=%%~dpf"
:: --- CLEANING STEP ---
set "clean=!filename: =_!"
set "clean=!clean

=_!"
set "clean=!clean

=_!"
set "clean=!clean:[=_!"
set "clean=!clean:]=_!"
set "clean=!clean:&=_!"
set "clean=!clean:+=_!"
set "clean=!clean:,=_!"
:: Rename if the name changed
if not "!filename!"=="!clean!" (
echo Renaming "%%~nf" to "!clean!"
ren "%%f" "!clean!.cwp"
set "target=!folder!!clean!.cwp"
) else (
set "target=%%f"
)
:: --- CONVERSION STEP ---
echo Converting: "!target!"
if exist "%converter%" (
start /b wscript.exe "%temp%\press_ok.vbs"
"%converter%" "!target!"
) else (
echo ERROR: Converter not found at %converter%
)
)
:: Cleanup helper
if exist "%temp%\press_ok.vbs" del "%temp%\press_ok.vbs"
echo.
echo Done!
pause
<<REMOVE THE SMILY FACES"