tags:

views:

161

answers:

1

Dear all i created a batch file which uninstall my application .. my problem is this uninstallation deleted some files and keeps others for example i created a folder in C:\Documents and settings\User-Name\myCompanyName\My Application name\ this folder contains all files for my application now when i uninstall all these files are deleted but i want to delete "myCompanyName" folder too from "C:\Documents and settings\User-Name"

also another problem related to the previouse is that i added a new folder to the start menu called myComapny this holes 4 files : exe file, config file, help file, and uninstall file now when i click on the uninstall file i removes everything but still keeps this folder in the startmenu containing the exe file, and config file...

so how to delete these unwanted folders through the batch file...

here is my batch file code:

   @echo off
   msiexec /x {DD75996F-C279-420A-9A19-48EF9EFE70C2} 

   RD /s "C:\Program Files\ASGATech"
   RD /s "C:\Documents and Settings\%userprofile%\start menu\programs\ASGATech"
   pause

NOTE: i tried to change the extension of the batch file from bat to cmd ... notice that i tried to get the current login user %userprofile% to go to his/her start menu ... if this way is wronge please inform me

+3  A: 

Remove the C:\Documents and Settings - this is already in the %userprofile% tag.

RD /s "%userprofile%\start menu\programs\ASGATech"

Jens Jansson
what about the first line RD /s "C:\Program Files\ASGATech"it's also doesn't removed
Eng.Basma
Might it be some problem with that 'rd' checks with the user "are you sure (y/n)"? Do you get query? Try adding /Q after /S. This means that it will not ask the users permission. I tested these and it did delete folders like you specified.
Jens Jansson
mmmmmmmm how bad luck it's still not working with me ... what do you think the problem is ?!?! i put the batch file in the User program's menun under a folder called ASGATech. this folder holds the application primary output, help shortcut config, and uninstall shortcut...so what is the problem
Eng.Basma
hard to say without more input. try to take @echo off away and see if you get some constructive output
Jens Jansson