1-888-310-4540 (main) / 1-888-707-6150 (support) info@spkaa.com
Select Page

Trigger UAC to Ensure Scripts are run As Administrator in Windows 7

Written by SPK Blog Post
Published on April 10, 2014
I wanted to post this solution since we run into this problem all the time:

Often, our .bat scripts include making registry changes or copying files which require Administrative access. This code will cause the .bat file to trigger a UAC prompt before running AsAdministrator — allowing us to make those registry changes instead of getting permission errors.

Be careful, though – make sure you map network drives or make environment changes at the end of the file; relaunching a file as Administrator means you will not have the same Environment or Map Drives as the User in Windows 8.

Download our How-To Guide to Trigger UAC to Ensure Scripts are run As Administrator in Windows 7 below.

Latest White Papers

The Next Chapter of Jira Service Management

The Next Chapter of Jira Service Management

The service industry is only becoming more competitive as the years pass, making efficient delivery vital to success. Development and Operations teams need to work together to deliver aid and Jira Service Management can help achieve this. Explore the future of Jira...

Related Resources

Exploring Modern Software Deployment Strategies

Exploring Modern Software Deployment Strategies

Deploying software can feel like a gamble due to all the strategies and solutions on the market, but it doesn’t have to be. Discovering which software deployment strategy works best for your organization is a great place to start. This strategy, combined with a modern...

Automatically Visualizing Dependencies in Codebeamer

Automatically Visualizing Dependencies in Codebeamer

If you work in the software and systems engineering space, you likely understand that managing dependencies across multiple components and requirements is critical for project success. Unfortunately, specifications can be difficult to track, and dependencies hard to...

A 3-Phase Approach to Automated Software Delivery

A 3-Phase Approach to Automated Software Delivery

Is your software delivery process outdated? Modernizing your software delivery workflows does not have to be difficult. Explore this eBook to discover how GitLab can help you modernize your software delivery pipelines. What You...