Silent Uninstall for Microsoft Visual Studio all version

hi all
has anyone ever uninstalled microsoft visual studio
may i know how ?
is it using bat file or anything else.
currently iam looking for script silent uninstall for visual studio.
is there anyone can help me to do this ?

1 option could be to have the actionscript so that its creates a batch script on the fly containing msiexec /x command for each application GUID owned by Visual Studio that exists in the registry, then execute the batch script.

createfile until EOF
{("msiexec.exe /x" & name of it & " /qn%0a") of (keys whose ((value "DisplayName" of it as string as lowercase contains "microsoft visual studio" as lowercase) and (value "Publisher" of it as string as lowercase contains "microsoft" as lowercase) and (value "uninstallstring" of it as string as lowercase contains "msiexec.exe")) of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (registry ; native registry))}
EOF

delete Uninstall.cmd
copy __createfile Uninstall.cmd
waithidden Uninstall.cmd

Of course I would suggest you test this first before trying to use on live systems

hi slb
thanks for your reply
when i create bat file for above script and running it manuallya (double click in my laptop testing)
it will be running, but the visual studio still in the laptop.

i also create another batch file
with the script below

@echo off

“\myserver\Visual Studio 2012\vsta_setup2012.exe” /uninstall /force /quiet /silent
exit

if i ran it manually (double click) in my testing laptop, it can remove the visual studio.

but when i try to upload into tivoli ( iam using tivoli console 9.2.2.21) it can’t

in action script iam using this script
download http://myserver:52311/Uploads/vs2012_3.bat
if{x64 of operating system}
action uses wow64 redirection false
endif
waithidden cmd.exe /c __Download\vs2012_3.bat /p /r”

status is completed.
but didnt remove visual studio

If your referencing a resource on a file share in your batch, as its being run by Bigfix in the SYSTEM context the resource will be not accessible so would then not act as when running as a user. You could use the override method in the actionscript to run the action as the current user, which does mean of course all users need access to the network resource, and that a user needs to be logged in for the action to run.

hi slb,
cmiiw
so i must revise the script in action script bigfix like this ?

download http://myserver:52311/Uploads/vs2012_3.bat
if{x64 of operating system}
action uses wow64 redirection false
endif
RunAs=currentuser
waithidden cmd.exe /c __Download\vs2012_3.bat /p /r”

You will need to invoke the override method so it should be more like

download http://myserver:52311/Uploads/vs2012_3.bat
if{x64 of operating system}
action uses wow64 redirection false
endif
override wait
hidden=true
runas=currentuser
wait cmd.exe /c __Download\vs2012_3.bat /p /r”

Do your users have Administrator rights? A standard user account won’t have permission to uninstall.

hi jason,

some users dont have administrator rights.

is there any way for users who dont have administrator rights?

hi slb,

thank for your respond.
currently iam trying to deploy it again.
and will update the result soon.

for command runas current user, is it the users logon should have administrator right?
because current user in my testing laptop dont have administrator right.( only standard user)

The user issue is only as you are using a network resource for the source files so the context Bigfix runs as does not have access. Using a network resource is not a method I use so can’t share any experience with you on that. When I have removed software, msiexec /x{product-guid} /qn /norestart has worked for me for MSI based products. Maybe others in the forum have use case experience they can share. You could use psexec from SysInternals to see if running the msiexec interactively as the SYSTEM account produces any further info that might help identify reason for that approach not working.

hi slb
sorry for late reply
ive been try using msiexec /x{product-guid} /qn /norestart but when i try it in to bigfix
its always completed status, but the application not remove.

Please post your actionscript.

hi slb

here is my actionscript for vstudio tools 2017

waithidden “{pathname of system wow64 folder}\msiexec.exe” /X{{10AB056B-1B8C-3E9E-95CC-43C33EB88513} /QN /L

status completed.
but application still appear in control panel - program and features.