Script to uninstall with elevated privileges

I need a down and dirty batch file that will uninstall a program that does not respond to the wmic command structure. The batch file will be run by normal users but has to be run with administrator level privileges. I have written the batch file, but using the "runas" command parameter in my file, requires the user to input the admin password. Not something I want to do.  

runas user: domain\elevated_account_name
\\servername\install\applicationfolder\application_name.exe /uninstall
\\servername\install\applicationfolder\sleep.exe 5
exit

Any ideas would be gratefully appreciated.
Bob ConklinConfiguration/TEST TechnicianAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oBdACommented:
Distribute the script as computer startup script; a startup script runs in the System context and has the necessary permissions.
Make sure that the group "Domain Computers" has Read Share and NTFS permissions on the "install" share.
Assign computer startup scripts
https://technet.microsoft.com/en-us/library/cc779329(v=ws.10).aspx
0
Adam LeinssServer SpecialistCommented:
I've used something like this before: http://www.battoexeconverter.com/

Pretty much any BAT2EXE converter should work the same.
0
Bob ConklinConfiguration/TEST TechnicianAuthor Commented:
Hi oBdA
We have AGPM in place here at our location and I do not have the option to make start up scripts as corporate has that locked down. For Adam's suggestion, I downloaded the software in question but still can't seem to get past the need to run the uninstaller with admin level privileges. I found a power shell script that promised to check for elevated privileges and if not found was supposed to spawn another instance in elevated mode. So far that has not worked either. Looks like I will start visiting each system and embark upon the popular pass time of hand laying.
0
Adam LeinssServer SpecialistCommented:
psexec will accept the password, then you can use the bat2exe option.

Example:

C:\RunAs\PsExec.exe -accepteula -u somedomain\AdobeUpdateAdmin -p Passw0rd "C:\Program Files\TraxStar\TraxClient\TraxLaunch.exe" 10.1.1.30 8090 "C:\Program Files\TraxStar\TraxClient\qatrax.exe" 8091

This requires psexec.exe to be in the same directory as the exe and you can provide the password to psexec unlike Runas.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob ConklinConfiguration/TEST TechnicianAuthor Commented:
While all the suggestions were good ones, in this instance none of the solutions worked out. We were forced to do the uninstall manually on all of the effected systems.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.