none
Batch file question RRS feed

  • Question

  • I am trying to write a uninstall batch file, below is what I have written. However when the WMIC part runs and the prompt changes the script stops and does not continue to the second line. Any help would be great. Also if this issue can be fixed how would I issue the Yes switch? If I run it manually it will ask for a y or n to confirm the uninstall.


    @Echo off
    C:
    cd\
    cd "\windows\system32\"

    WMIc

    product where vendor="Citrix online plug-in <PNA>" call uninstall

    :end

    Monday, November 16, 2015 2:10 PM

Answers

  • This is easier if you just use a command like the following:


    msiexec /x "{application ID GUID}" /qb
    

    You can get the value for the application ID GUID by looking at the output of this command (cmd.exe):


    C:\>wmic product get Name,IdentifyingNumber
    

    or in PowerShell:


    PS C:\> Get-WmiObject Win32_Product | Select-Object Name,IdentifyingNumber
    

    (IdentifyingNumber is the application ID GUID.)


    -- Bill Stewart [Bill_Stewart]

    Monday, November 16, 2015 3:35 PM
    Moderator

All replies

  • This is easier if you just use a command like the following:


    msiexec /x "{application ID GUID}" /qb
    

    You can get the value for the application ID GUID by looking at the output of this command (cmd.exe):


    C:\>wmic product get Name,IdentifyingNumber
    

    or in PowerShell:


    PS C:\> Get-WmiObject Win32_Product | Select-Object Name,IdentifyingNumber
    

    (IdentifyingNumber is the application ID GUID.)


    -- Bill Stewart [Bill_Stewart]

    Monday, November 16, 2015 3:35 PM
    Moderator
  • Thanks, this is a big help
    Monday, November 16, 2015 3:53 PM