Skip to main content
The 2024 Developer Survey results are live! See the results
edited body
Source Link
Io-oI
  • 8.3k
  • 3
  • 13
  • 41

Can anyone help me to cratecreate a Windows batch script equivalent of Windows PowerShell script that I wrote. I know what first few lines should be, but I am not shoresure for the rest.

PowerShell Code:

Get-Process -Name Firefox | Stop-Process

Start-Process -FilePath "C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30
Start-Process -FilePath "C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30

$UserProfiles = Get-ChildItem -Path "C:\Users" -Exclude "Public", "Default"

foreach ($Profile in $UserProfiles) {
    Remove-Item -Path "$Profile\AppData\Roaming\Mozilla\Firefox" -Force -Recurse -ErrorAction SilentlyContinue -Confirm:$false
}

Batch Code:

taskill Firefox
"C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ms
"C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ms
...

Can anyone help me to crate a Windows batch script equivalent of Windows PowerShell script that I wrote. I know what first few lines should be, but I am not shore for the rest.

PowerShell Code:

Get-Process -Name Firefox | Stop-Process

Start-Process -FilePath "C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30
Start-Process -FilePath "C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30

$UserProfiles = Get-ChildItem -Path "C:\Users" -Exclude "Public", "Default"

foreach ($Profile in $UserProfiles) {
    Remove-Item -Path "$Profile\AppData\Roaming\Mozilla\Firefox" -Force -Recurse -ErrorAction SilentlyContinue -Confirm:$false
}

Batch Code:

taskill Firefox
"C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ms
"C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ms
...

Can anyone help me to create a Windows batch script equivalent of Windows PowerShell script that I wrote. I know what first few lines should be, but I am not sure for the rest.

PowerShell Code:

Get-Process -Name Firefox | Stop-Process

Start-Process -FilePath "C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30
Start-Process -FilePath "C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30

$UserProfiles = Get-ChildItem -Path "C:\Users" -Exclude "Public", "Default"

foreach ($Profile in $UserProfiles) {
    Remove-Item -Path "$Profile\AppData\Roaming\Mozilla\Firefox" -Force -Recurse -ErrorAction SilentlyContinue -Confirm:$false
}

Batch Code:

taskill Firefox
"C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ms
"C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ms
...
edited body
Source Link
Zoran Jankov
  • 446
  • 2
  • 4
  • 18

Can anyone help me to crate a Windows batch script equivalent of Windows PowerShell script that I wrote. I know what first few lines should be, but I am not shore for the rest.

PowerShell Code:

Get-Process -Name Firefox | Stop-Process

Start-Process -FilePath "C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30
Start-Process -FilePath "C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30

$UserProfiles = Get-ChildItem -Path "C:\Users" -Exclude "Publuc""Public", "Default"

foreach ($Profile in $UserProfiles) {
    Remove-Item -Path "$Profile\AppData\Roaming\Mozilla\Firefox" -Force -Recurse -ErrorAction SilentlyContinue -Confirm:$false
}

Batch Code:

taskill Firefox
"C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ms
"C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ms
...

Can anyone help me to crate a Windows batch script equivalent of Windows PowerShell script that I wrote. I know what first few lines should be, but I am not shore for the rest.

PowerShell Code:

Get-Process -Name Firefox | Stop-Process

Start-Process -FilePath "C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30
Start-Process -FilePath "C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30

$UserProfiles = Get-ChildItem -Path "C:\Users" -Exclude "Publuc", "Default"

foreach ($Profile in $UserProfiles) {
    Remove-Item -Path "$Profile\AppData\Roaming\Mozilla\Firefox" -Force -Recurse -ErrorAction SilentlyContinue -Confirm:$false
}

Batch Code:

taskill Firefox
"C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ms
"C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ms
...

Can anyone help me to crate a Windows batch script equivalent of Windows PowerShell script that I wrote. I know what first few lines should be, but I am not shore for the rest.

PowerShell Code:

Get-Process -Name Firefox | Stop-Process

Start-Process -FilePath "C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30
Start-Process -FilePath "C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30

$UserProfiles = Get-ChildItem -Path "C:\Users" -Exclude "Public", "Default"

foreach ($Profile in $UserProfiles) {
    Remove-Item -Path "$Profile\AppData\Roaming\Mozilla\Firefox" -Force -Recurse -ErrorAction SilentlyContinue -Confirm:$false
}

Batch Code:

taskill Firefox
"C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ms
"C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ms
...
Source Link
Zoran Jankov
  • 446
  • 2
  • 4
  • 18

Windows batch script equivalent of a Windows PowerShell script

Can anyone help me to crate a Windows batch script equivalent of Windows PowerShell script that I wrote. I know what first few lines should be, but I am not shore for the rest.

PowerShell Code:

Get-Process -Name Firefox | Stop-Process

Start-Process -FilePath "C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30
Start-Process -FilePath "C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "-ms" -ErrorAction SilentlyContinue -PassThru | Wait-Process -Timeout 30

$UserProfiles = Get-ChildItem -Path "C:\Users" -Exclude "Publuc", "Default"

foreach ($Profile in $UserProfiles) {
    Remove-Item -Path "$Profile\AppData\Roaming\Mozilla\Firefox" -Force -Recurse -ErrorAction SilentlyContinue -Confirm:$false
}

Batch Code:

taskill Firefox
"C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ms
"C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe" -ms
...