https://www.joci.net/xxbk/126251/
FileMon和Regmon不再可供下载。从Windows 2000 SP4,Windows XP SP2,Windows Server 2003 SP1和Windows Vista开始的Windows版本上,它们已被Process Monitor取代
Machine GUID不是唯一
- 打开以管理员身份运行的CMD提示
- 通过让WMIC产生一个列表来找出程序的确切名称:
wmic product get name
- 使用WMIC PRODUCT NAME命令删除所需的程序
wmic product where name ="<PROGRAM NAME HERE>" call uninstall /nointeractive
如果不使用/ nointeractive开关,则WMIC将提示用户确认卸载,这可能会破坏编写卸载脚本的目的。
还要注意,通配符可以与WMIC一起使用,但是命令略有不同:
wmic product where "name like '
<PROGRAM NAME HERE>
%%'" call uninstall
您还可能需要清理安装文件夹(如果仍然存在),请使用:
rd /s /q C:\Program Files\<PROGRAM FOLDER NAME HERE>
http://www.instedit.com/home.html
msiexec.exe <install_option> <path_to_package> [package_parameters]
使用安装MSI卸载
如果仍然可以访问.MSI安装文件,则可以简单地运行:
msiexec /x <PROGRAM NAME HERE>.msi /q
使用应用程序的GUID卸载
如果您无权访问.MSI安装文件:
- 通过打开REGEDIT并展开来找出程序的GUID:
HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows > CurrentVersion > Uninstall
- 在以ADMIN身份运行的CMD窗口中或以ADMIN身份运行的脚本中,如:
msiexec /quiet /norestart /uninstall {<GUID>}
msiexec /quiet /norestart /uninstall {7FCA6452-46F2-452F-A5A7-DAB7DE12D0E6}
如何使用PowerShell卸载程序
- 您可以使用上述e WMIC方法中的前两个步骤来确定确切的程序名称
- 在以管理员身份运行的PowerShell中使用以下命令:
$app = Get-WmiObject -Class Win32_Product -Filter "Name = '<PROGRAM NAME HERE>'"
$app.Uninstall()
How do I use a batch file to silently install/uninstall from the command line?
These examples show how you can run a batch file to silently install or uninstall Studio and Runtime from the command line.
Note: You do not need to use the runas prefix if you are already running as the user you want to install as.
Installing Runtime silently
runas /user:"Administrator" "msiexec /i C:\Test\5.2.259\OpenSpanRuntimeEntSetup.x64.msi /qn /lv C:\Test\runtime5.2.259.log" pause
You can also pass parameters to the installer if you want to change the default settings, such as enabling server connectivity. Here is an example of a Runtime install with parameters:
runas /user:"Administrator" "msiexec /i C:\Test\5.2.259\OpenSpanRuntimeEntSetup.x64.msi /qn /lv C:\Test\runtime5.2.259.log SERVERCONNECTIVITYENABLED=TRUE SERVERHOSTNAME=myserver.com" pause
Uninstalling Runtime silently
runas /user:"Administrator" "msiexec /x C:\Test\HF5.2.259.17\OpenSpanRuntimeEntHF23626x64.msi /qn /lv C:\Test\UninstallRuntime5.2.259.17.log" pause
Installing a patch silently
runas /user:"Administrator" "msiexec.exe /update C:\Test\HF5.2.259.17\OpenSpanRuntimeEntHF23626x64.msi /qn /lv C:\Test\runtimeHF5.2.259.17.log" pause
Uninstalling a patch silently
runas /user:"Administrator" "msiexec /uninstall C:\Test\HF5.2.259.17\OpenSpanRuntimeEntHF23626x64.msi /package C:\Test\5.2.259\OpenSpanRuntimeEntSetup.x64.msi /qn /lv C:\Test\UninstallRuntime5.2.259.17.log" pause
Note: When uninstalling just a patch, keep in mind that you must pass in the path to the original MSI.
FOR /F "usebackq delims==" %i IN (`set`) DO @echo %i
会枚举当前环境中的环境变量名称
评论
发表评论