Uninstalling Windows Hotfix via C# or PowerShell - c#

In our Company we need to uninstall a Windows Hotfix thats installed on the System. I've done a PowerShell Script that checks if the specified Update (Lookup via KBArticleID) is installed or not and then reports this via Textfile to the Server.
There is a Windows built-in Tool called WUSA (Windows-Update-Standalone-Installer) that allows to uninstall Updates with a specified KB-Article-ID. The Problem is that under Windows 7, 8.1 and 10 the WUSA-Tools only works in normal interactive Mode and not in the quiet Mode that we need. I'm running like this:
wusa.exe /uninstall /kb:3114409 /norestart /quiet
As described the Problem is that this command will only run in Interactive Mode and not Quiet.
Do you have any solutions or hints? I would prefer to implement this via PowerSehll or C# but other Solutions are welcome too :)
Thanks for your help!

Old post, but the heck..
I tried this on a windows 2012 R2 server and it worked:
Start-Process wusa.exe -ArgumentList '/KB:3170455 /uninstall /quiet /norestart' -Wait

Related

How to programmatically install "Feature update to Windows 10, version 1607"

I have a Windows 10 desktop machine and I want to install "Feature update to Windows 10, version 1607".
I have managed to use PowerShell modules like https://www.petri.com/manage-windows-updates-with-powershell-module here to automate installation of the KBs.
The above mentioned module is also listed as KB3012973 but installing it via the below commands doesn't install it.
Set-ExecutionPolicy Unrestricted
Import-Module PSWindowsUpdate
Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d -Confirm:$false
Get-WUInstall -MicrosoftUpdate -AcceptAll -AutoReboot
It appears that this KB is in fact an ISO.
Can any one please help?

How can I install .Net 3.5 on Windows 10?

I need to install .Net 3.5 so I can use SQL Server Express/Local Db in Visual Studio.
I have trawled the internet looking for answers and nothing works.
It got stuck on this all night, this is enabling .Net 3.5 from the Control Panel.
I even redownloaded Windows 10 and run this DISM command
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:c:\sources\sxs
but it still hangs and won't do anything.
If anyone could help me out that would be super helpful
.NET 3.5 cant be install by internet. you have to use your installation DVD or ISO downloaded from Microsoft website.
use this command to install
DISM /Online /Enable-Feature /FeatureName:NetFx3 /Source:d:\sources\sxs /All /LimitAccess
d: should be the
ISO mapped drive if you use ISO file
DVD drive if you use installation DVD
Few important points.
If you use ISO file, There can be errors if you try to use a ISO from a network location.
If you download ISO from Microsoft web site careful about 32 bit and 64 bit.
Run command prompt as Administrator to run this command
If your command prompt hang without any response, probably it means Some windows updates installation is in progress. So restart the computer and try again.
Go to "Turn Windows feature on or off" window.If you installed properly, you can see .NET framework 3.5 is installed.
Here is the step by step guide I have written. http://codeketchup.blogspot.sg/2015/11/how-to-install-net-framework-35-on.html
If you have access to MSDN subscription, download the Windows 10 Features on Demand ISO, mount it and run this command:
DISM.EXE /Online /Add-Capability /CapabilityName:NetFx3~~~~ /Source:D:\
(where D: is the mounted ISO)
If this fails, run this command to add the files back to your Windows
DISM.EXE /Online /Add-Package /PackagePath:D:\Microsoft-Windows-NetFx3-OnDemand-Package.cab
and now go to the UI to enable the feature.
If you don't have your Windows installation media at hand or want it easier:
These are the methods without the commandline DISM command, which work interactively- for the first two you need current internet access:
Normally it is enough to start an application requiring .NET 3.5 and Windows will bring up a dialog for installation over internet.
Type "windows feature" in the magnifier (search) line besides the start button and switch to
Turn Windows features on or off
Control panel
Then you find the known dialog from previous versions to turn .NET 3.5 features on, etc. (At least I was unable to find it from new settings dialog without search.)
If you updated Windows 10, and you had .NET 3.5 activated before on Win 7 or 8.x, then you have to do nothing, it is also activated in Windows 10.
Here is the real offline "emergency" installer:
http://www.smart-arab.com/2013/12/install-net-on-windows-8-1-and-windows-10-offline/
Of course this is not the official way.
You need to go to add remove programs and then add features to windows, then select it from here. This will install .net 3.5 and 2.0
edit 1
Please open a command prompt (cmd.exe) as admin and run the following command to install .Net 3.5:
DISM /Online /Enable-Feature /FeatureName:NetFx3 /Source:d:\sources\sxs /All /LimitAccess
(replace D: with your mounted Win10 ISO)
In some environment, DISM fails to fetch the file (Proxy, network policies). The DISM command takes the files from the DVD and you're fine
1. Open CMD as an administrate
Command: Dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess
here D=partition name Mout
Open ISO file of windows 10 and type D where Partition.
Finally Open Windows Features and then you will see Net Framework 3.5 has been install and enable.

how to deploy windows phone 10 application to a device?

I am using a Nokia lumia630 device, which uses latest windows 10 insider preview build available.
i created a sample windows UWP application and took a build of the same.The output of the build is an Appx.
How can i install this Appx to my device? Anyone having any idea?
Deploying apps to Win 10 Mobile is a bit difficult when using the command line tool. A great alternative is the Device Portal that is available under the “For Developer” settings.Its available with the latest build.
Now You can connect to the device using a web browser and manage apps via the Apps page with no pairing/pin required. This seems to be an easy way of deploying apps than using command line.
Microsoft developed a command line tool called WinAppDeployCmd so you can deploy an Universal Windows app from a Windows 10 machine to any Windows 10 Mobile device via USB or WiFi (since they're on the same subnet). That's a perfect solution if you doesn't have Visual Studio, the app source code or you're under a Hyper-V Virtual Machine.
Basically you will need:
Windows 10 SDK
Generate the .appx package (PC)
Enable the developer mode (Mobile)
Turn on the discovery mode (Mobile)
Get the code to pair devices (Mobile)
Get mobile IP address using WinAppDeployCmd tool (PC)
Run command (PC)
The command will look like this
WinAppDeployCmd install -file “<path>” -ip <ip> -pin <pin>
The tool can be found at C:\Arquivos de Programas (x86)\Windows Kits\10\bin\x86\WinAppDeployCmd.exe
You can find a detailed step-by-step tutorial here
Visual Studio allows you to directly deploy an app to a windows phone. You need to register your windows phone as a development phone with Microsoft. Once this is done, you could use visual studio to do this for you. Not sure if you can deploy windows 10 apps to your phone at the moment. Try this link and see:
https://msdn.microsoft.com/en-us/library/windows/apps/ff769508%28v=vs.105%29.aspx Remember to Upvote if this helps.
You can register your Windows Phone 10 in developer mode. Follow these steps and you can achieve your goal.
When you use device portal like mentioned in the answers above, some might get the following error
"Failed to start deployment. Failure text: Package failed updates, dependency or conflict validation. (0x80073cf3)"
To fix this:
Add the dependencies found under "Dependencies/ARM" folder.Add it here.
I had to add following dependencies to make it work:
Microsoft.NET.CoreRuntime.1.0.appx
Microsoft.VCLibs.ARM.Debug.14.00.appx

How can I repair .NET Framework 4.0 on Windows 8?

While trying debug my real problem, I'm trying to repair the .NET framework, because it looks like something in System.Data.SqlClient is hosed. But you can't uninstall this because it's part of the OS in Windows8, and you can't install it because it's already installed, and so I can't find any way to fix my problem. I suppose I could reinstall the whole OS, but that's way too painful.
To Repair corrupted Windows files in Windows 8, open a command prompt with admin rights and run this DISM command:
DISM /Online /Cleanup-Image /RestoreHealth
This downloads the clean files and installs them correctly.

How to silent install Postgresql on Windows 7

I want to install "postgresql-9.1.3-1-windows-x64.exe" on windows 7 silently.
Where can i find msi install of postgresql-9.1.3.1
Thank you
Zak
postgresql-9.1.3-1-windows-x64.exe can be downloaded from sourceforge. This link might help you for silent installation.
I've the same problem with PostgreSQL on Windows7 x64, well the solutions that success for me is:
Create user postgres and set up password. (User Administrative Tools).
Create C:\postgres and set up security full control to user postgres.
Execute installer and set C:\postgres as root directory
Enjoy it xD
that is all.
Run this command:
postgresql.exe --mode unattended
--superpassword youpassword
--serverport 5432
--unattendedmodeui none
--prefix "c:\postgrespath"
--datadir "c:\postgrespath\datapath"

Categories

Resources