I have a MSI that deploys a shortcut that runs a batch file. How do I get this to run with elevated rights as a Standard User?
2. Your script doesn't check that the uninstall completed successfully before blundering on to the installation.
3. Most MSIs will be authored to automatically upgrade an app - presumably these are related apps? - with no need to explicitly uninstall previous versions.
4. You should add verbose logging to your command line, or trouble-shooting issues will be pretty much guesswork.
5. If you're deploying via any sort of purpose built system, it will most likely be using the local System account, so there's no need for elevation.
I agree with RileyZ, technically, 'it cant be done'. A std user is, by definition, a std user.
BUT, you can with some tools do things so when a std users is logged in you can run something, like the above. But you would have to do a runas and input the credentials (user name AND Password) of an admin user.
I have done it with vbs (then encrypted it) also with the autoit approach. These are both very bad options. I also get the feeling you are going to say, the builds are different, so you wont be able to say for sure what the password is for a local amdin user.