私は現在、WES 7 デバイスにインストールされているプログラムの多数のアンインストールを含むスクリプトを作成しています。アンインストールする必要があるアプリケーションの 1 つ (VMware Horizon View Client) が再起動を要求します。これがスクリプトの一部である場合、既定のボタン (YES) を受け入れるように見え、デバイスの再起動に進みます。したがって、スクリプトは失敗します。
この再起動が行われないようにする方法について、ご協力をお願いいたします。
参考までに: このスクリプトは管理ツールを介して送信され、ターゲット上で昇格された方法で実行されます。
これは私のスクリプトです:
set-executionpolicy unrestricted
#############################################################
# Un-install unwanted applications
#############################################################
$application = Get-WMIObject Win32_Product -filter "Name='ThinPrint Client Windows 8.6'"
$application.Uninstall()
$application = Get-WMIObject Win32_Product -filter "Name='2X Client'"
$application.Uninstall()
$application = Get-WMIObject Win32_Product -filter "Name='Adobe Reader X (10.1.4)'"
$application.Uninstall()
$application = Get-WMIObject Win32_Product -filter "Name='VMware Horizon View Client'"
$application.Uninstall()
$application = Get-WMIObject Win32_Product -filter "Name='VERDE VDI User Tools'"
$application.Uninstall()
$application = Get-WMIObject Win32_Product -filter "Name='vWorkspace Connector for Windows'"
$application.Uninstall()
#############################################################
# Remove Internet Explorer Access
#############################################################
dism /online /norestart /Disable-Feature /FeatureName:Internet-Explorer-Optional-x86
#############################################################
# Remove IE Browser LNK from Taskbar
#############################################################
del "C:\Users\User\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Launch Internet Explorer Browser.lnk"
#############################################################
# Make Citrix Receiver the shell
#############################################################
Push-Location
CD 'HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon'
New-Itemproperty -path .\ -name Shell -Type String -Value 'c:\program files\Citrix\Receiver\receiver.exe'
Pop-Location
set-executionpolicy restricted
# End of Script
スクリプトの途中で再起動を防ぐ方法について、いくつかの助けをいただければ幸いです。