Windows 7 是否有针对windows的程序批卸载?

Windows 7 是否有针对windows的程序批卸载?,windows-7,batch-file,windows-xp,uninstallation,Windows 7,Batch File,Windows Xp,Uninstallation,我有几个程序要从我的计算机上卸载(Windows 7 64位) 是否有一个批处理\脚本可以帮助我这样做?或者我需要从控制面板一个接一个地做 如果Windows 7没有,XP中是否有类似的功能 谢谢, Dor.据我所知,cmd中并没有真正的卸载命令之类的东西。但是,您可以查询此注册表项 HKEY\U LOCAL\U MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall (如果您在64位计算机上,可能还需要检查HKEY\U LOCAL

我有几个程序要从我的计算机上卸载(Windows 7 64位)

是否有一个批处理\脚本可以帮助我这样做?或者我需要从控制面板一个接一个地做

如果Windows 7没有,XP中是否有类似的功能

谢谢,
Dor.

据我所知,cmd中并没有真正的
卸载
命令之类的东西。但是,您可以查询此注册表项

HKEY\U LOCAL\U MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

(如果您在64位计算机上,可能还需要检查
HKEY\U LOCAL\U MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

查找要卸载的程序。每个卸载程序都有一个
UninstallString
值,该值将告诉您程序卸载程序文件的路径,然后您可以通过调用其完整路径和文件名来执行该文件

如果卸载程序恰好是msi,则可以使用

msiexec/uninstall/x
以静默方式卸载它。我想这差不多是你们用批处理所能做到的


希望这有帮助

要补充巴厘岛的答案,请尝试以下代码

@echo off
for /f "tokens=*" %%a in ('reg query hklm\software\Microsoft\Windows\CurrentVersion\Uninstall\ ^| find /I "%*"') do (
  for /f "tokens=1,2,*" %%b in ('reg query "%%a" /v UninstallString ^| find /I "UninstallString"') do (
    if /i %%b==UninstallString (
      echo %%d
    )
  )
)

仔细测试。然后删除echo命令。

我今天早上写的

@Echo off
Echo This is a batch file uninstallation program. 
Echo Run as administrator WMIC will not work. 
echo.
Echo The command [wmic product get name] will run.
Echo Looking up all installed programs...
echo. 
wmic product get name

 echo 1. First program
 echo 2. Second program
 echo 3. Third program
 echo 4. Fourth program
 echo 5. Fifth program
echo.
@echo Pick a number: 
echo. 
 choice /c:12345 

 if "%errorlevel%"=="1" wmic product where name="First program" call uninstall
 if "%errorlevel%"=="2" wmic product where name="Second program" call uninstall
 if "%errorlevel%"=="3" wmic product where name="Third program" call uninstall
 if "%errorlevel%"=="4" wmic product where name="Fourth program" call uninstall
 if "%errorlevel%"=="5" wmic product where name="Fifth program" call uninstall

Echo.
Echo.

@echo First method is done. I'll go into the alternate method. 

pause
Echo Get user input - program name?
Echo.
Echo This is an alternate method 
:input
set INPUT=
set /P INPUT=Uninstall which program?: %=%
if "%INPUT%"=="" goto input
echo Your input was: %INPUT%

echo.
echo.
Echo Uninstalling... 

echo The command [wmic product where name="%INPUT%" call uninstall] will run. 


wmic product where name="%INPUT%" call uninstall

@echo If there is "no instance" errors, then the program %INPUT% was uninstalled.

pause

从终端直接使用wmic。您可以查看microsoft的文档以了解更多用法

这将是一个很好的起点:

wmic product where vendor="Autodesk" call uninstall

我使用上面这一行来清理卸载autodesk产品。

如果您不需要(命令行)批处理,那么BCUninstaller很适合在Windows中一次删除和清理多个sotfwater:

为什么不为每个程序运行uninstall.exe?您可以编写一个批处理文件,在搜索的目录中查找卸载程序。i、 e:你搜索Java并在Java文件夹中运行uninstall.exe。我建议你试试巴厘岛的答案。它看起来更有希望。^这是执行命令行要求的最佳方法。虽然我更喜欢
wmic
解决方案,但对我来说,大多数安装的应用程序似乎不在
wmic产品get name
列表中。但是,它们列在注册表中的
卸载
项中。我想在我的情况下,我需要另一个建议的解决方案,你必须自己解析注册表。wmic行是我真正需要的。Add/nointeractive可跳过此过程中提出的所有问题。如果语法正确,您还可以使用通配符进行此类查询,这可能会很有趣:
wmic product,其中“类似于“%SQL Server%”的名称”调用uninstall将对名称包含字符串“SQL Server”的所有产品执行此操作。最好先使用
wmic产品之类的工具检查哪些内容受到影响,其中“名称如“%SQL Server%”列表摘要