Vista: How to set Compatibiltiy->Privilege Level of application to "run as administrator" in batch-file?

Posted on 2009-02-20
Last Modified: 2013-11-10
Hi everyone,

i have a setup which deploys some apps, these must be enabled to run as admins afterwards.
I hoped that by running the initial setup with "run as administrator" it would be inherited to the deployed apps, which does not happen. Seems like if you set the "run as admin" once for a file the OS remembers it, but you cannot "carry" the setting to another Vista-PC.
So I would run a batch-file as part of my deployment. With which command(s) in my batch-file do I set the privilege-Level to my apps?

Thanks in advance,
Question by:uac_user
    LVL 52

    Accepted Solution

    You could apply a so called shim.
    It's not as difficult as it sounds.
    Second possibility is to setup scheduled tasks (command line: schtasks.exe) and create shortcuts to those. Scheduled tasks can be set to run with highest privileges.
    LVL 2

    Expert Comment

    If you have the admin right for all the machines, should you be able to batch schtasks.exe to
    setup a job with "Run with hightest privileges" to execute the install, then
    again with schtasks.exe to tell it to run, then delete the job.

    get usage with:
    schtasks /?

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    wordsWithout 49 64
    Excel object stays open 19 56
    powerN  challenge 3 36
    How to run multiple lines in a batch file 4 47
    A short article about a problem I had getting the GPS LocationListener working.
    This is about my first experience with programming Arduino.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now