Windows batch script equivalent of a Windows PowerShell script
@echo off && Setlocal EnableDelayedExpansion
set^ "_Mozilla_Firefox=AppData\Roaming\Mozilla\Firefox\."
set^ "_Mozilla_helper_=Mozilla Firefox\uninstall\helper.exe"
set^ "_ProgramFiles=ProgramFiles,ProgramFiles(x86^),ProgramW6432"
set^ "_wmic=^<con: %__AppDir__%\wbem\wmic.exe" & cd /d "%__AppDir__%"
:again
tasklist.exe /svc /fo list|find.exe /i "firefox.exe" >nul && 2>nul ((
taskkill.exe /f /im firefox.exe >nul ) || ( timeout.exe /t 001 >nul & goto :again ))
for %%i in (!_ProgramFiles!)do if exist "!%%~i!\!_Mozilla_helper_!" (
start "Unistall Mozilla Firefox.exe" /Wait /Normal "!%%~i!\!_Mozilla_helper_!" -ms )
<nul cd /d "%UserProfile%" && cd.. && for /f usebackq^ ^tokens^=1*^ ^delims^=^= %%i in (
`%_wmic% UserAccount where status^='ok' get name/format:list^|%__AppDir__%more.com^|findstr.exe .
`)do call set^ "_%%~i=%%~j" && <con: call rmDir /q /s "!__cd__!\!_name!\!_Mozilla_Firefox!" 2>nul
popd & endlocal & goto :eof
Obs.: Try to think of a bat to perform the same task, it is easier than searching for a "translation" involving methods on ps1 that will not exist in cmd.