majd
May 9, 2020, 3:00pm
1
Hi every one
I used this line to uninstall Wise in silent mode:
cmd.exe /c “c:\wise”\Unwise32.exe /s /z “c:\wise\INSTALL.log” Application uninstall
what is the equivalent in powershell i tried to use Start-Process but then i get error message " coulldnot open install.log file"
sasaz
May 9, 2020, 3:10pm
2
Not sure about Wise but this is what I used. Note that not all programs have uninstall string in registry or can be uninstalled this way but you can try.
$uninstall32 = Get-ChildItem "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" `
| foreach { Get-ItemProperty $_.PSPath } | Where-Object {($_.displayname -like "*wise*")} | Select-Object UninstallString
$uninstall64 = gci "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" `
| ForEach-Object { Get-ItemProperty $_.PSPath } | Where-Object {($_.displayname -like "*wise*")} | Select-Object UninstallString
if ($uninstall64) {
$uninstall64 = $uninstall64.UninstallString -Replace "msiexec.exe","" -Replace "/I","" -Replace "/X",""
$uninstall64 = $uninstall64.Trim()
#Write-Host "Uninstalling..."
start-process "msiexec.exe" -arg "/X $uninstall64 /quiet /norestart" -Wait}
if ($uninstall32) {
$uninstall32 = $uninstall32.UninstallString -Replace "msiexec.exe","" -Replace "/I","" -Replace "/X",""
$uninstall32 = $uninstall32.Trim()
#Write-host "Uninstalling..."
start-process "msiexec.exe" -arg "/X $uninstall32 /quiet /norestart" -Wait}
also, you can try this
Get-Package *wise* | Uninstall-Package -Force -ForceBootstrap
Olaf
May 9, 2020, 4:04pm
3
Powershell is - just like cmd - a command line shell. So remove the stuff cmd needs and run the command just like it is … and you may correct your weird quoting.
"c:\wise\Unwise32.exe" /s /z "c:\wise\INSTALL.log" Application uninstall
majd
May 10, 2020, 7:15am
4
[quote quote=226927]Not sure about Wise but this is what I used. Note that not all programs have uninstall string in registry or can be uninstalled this way but you can try.
<textarea class="ace_text-input" style="opacity: 0; height: 17.6px; width: 6.59775px; left: 51px; top: 0px;" spellcheck="false" wrap="off"></textarea>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$uninstall32 = Get-ChildItem "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" `</div>
<div class="ace_line" style="height: 17.600000381469727px;"><span class="ace_keyword ace_operator">|</span> <span class="ace_keyword">foreach</span> { <span class="ace_support ace_function">Get-ItemProperty</span> <span class="ace_identifier">$_</span>.<span class="ace_identifier">PSPath</span> } <span class="ace_keyword ace_operator">|</span> <span class="ace_identifier">Where-Object</span> {(<span class="ace_identifier">$_</span>.<span class="ace_identifier">displayname</span> <span class="ace_keyword ace_operator">-like</span> <span class="ace_string">"*wise*"</span>)} <span class="ace_keyword ace_operator">|</span> <span class="ace_support ace_function">Select-Object</span> <span class="ace_identifier">UninstallString</span></div>
<div class="ace_line" style="height: 17.600000381469727px;"><span class="ace_variable ace_instance">$uninstall64</span> <span class="ace_keyword ace_operator">=</span> <span class="ace_identifier">gci</span> <span class="ace_string">"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"</span> `
| ForEach-Object { Get-ItemProperty $_ .PSPath } | Where-Object {($_ .displayname -like "*wise*" )} | Select-Object UninstallString
if ($uninstall64 ) {
$uninstall64 = $uninstall64 .UninstallString - Replace "msiexec.exe" ,"" - Replace "/I" ,"" - Replace "/X" ,""
$uninstall64 = $uninstall64 .Trim ()
#Write-Host "Uninstalling..."
start-process "msiexec.exe" - arg "/X $uninstall64 /quiet /norestart" - Wait }
if ($uninstall32 ) {
$uninstall32 = $uninstall32 .UninstallString - Replace "msiexec.exe" ,"" - Replace "/I" ,"" - Replace "/X" ,""
$uninstall32 = $uninstall32 .Trim ()
#Write-host "Uninstalling..."
start-process "msiexec.exe" - arg "/X $uninstall32 /quiet /norestart" - Wait }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
also, you can try this
<textarea class="ace_text-input" style="opacity: 0; height: 17.6px; width: 6.59775px; left: 44px; top: 0px;" spellcheck="false" wrap="off"></textarea>
Get-Package * wise * | Uninstall-Package - Force - ForceBootstrap
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[/quote]
I did not try your answer becasue i though one no need it for WISE uninstall but for another programms uninstall its very helpful.
Thanks alot
majd
May 10, 2020, 7:17am
5
"c:\wise\Unwise32.exe" / s / z "c:\wise\INSTALL.log" Application uninstall
[/quote]
Many thanks it works but one must usr call operator &
&“c:\wise\Unwise32.exe” /s /z “c:\wise\INSTALL.log”
c:\wise\Unwise32.exe /s /z “c:\wise\INSTALL.log”