Skip to main content
The 2024 Developer Survey results are live! See the results
added 158 characters in body
Source Link
Io-oI
  • 8.3k
  • 3
  • 13
  • 41
@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
@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.

@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.

@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.

added 7 characters in body
Source Link
Io-oI
  • 8.3k
  • 3
  • 13
  • 41
@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 01/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.

@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 01 >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.

@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.

added 61 characters in body
Source Link
Io-oI
  • 8.3k
  • 3
  • 13
  • 41
@echo off

Setlocal EnableDelayedExpansion && cd /dSetlocal %__AppDir__%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 1001 >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 (
`%__AppDir__%wbem\wmic.exe`%_wmic% UserAccount where status^='ok' get name/format:list^|more^|findstrlist^|%__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.

@echo off

Setlocal EnableDelayedExpansion && cd /d %__AppDir__%
set^ "_Mozilla_Firefox=AppData\Roaming\Mozilla\Firefox\." 
set^ "_Mozilla_helper_=Mozilla Firefox\uninstall\helper.exe"
set^ "_ProgramFiles=ProgramFiles,ProgramFiles(x86^),ProgramW6432"

:again
tasklist.exe /svc /fo list|find.exe /i "firefox.exe" >nul && 2>nul (( 
    taskkill.exe /f /im firefox.exe >nul )||( timeout.exe 10 >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 (
`%__AppDir__%wbem\wmic.exe UserAccount where status^='ok' get name/format:list^|more^|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.

@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 01 >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.

Source Link
Io-oI
  • 8.3k
  • 3
  • 13
  • 41
Loading