spk-logo-tm-2023
0%
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

windchill features best plm software
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 Future of AI-powered Service Management

The Future of AI-powered Service Management

As 63% of companies plan to increase AI spending this year, there is a large focus on the ROI of AI tools. Ensuring you get the most out of your investment is vital to business success, especially in the service industry. This eBook explores how teams can integrate AI...

Related Resources

Meet the Experts: Ginna Kang

Meet the Experts: Ginna Kang

Ginna Khang is an Applications Engineer focused on research and development (R&D).  She started at SPK and Associates in 2022 as an intern while she attended UC Santa Cruz.  After graduating in 2024, she was brought on full-time.  Here is more about Ginna in her...

Achieving Regulatory Compliance through Connected ALM and PLM Systems

Achieving Regulatory Compliance through Connected ALM and PLM Systems

Compliance is not always about having the right documentation.  In regulated industries, compliance is about proving that requirements are defined, changes are controlled, risks are addressed, tests are completed, and approvals are captured in a traceable, audit-ready...