Can i install a .bat as administrator?

Comments

1 comment

  • Avatar
    juanjo

    If the installer is not running elevated, the only way to run the .bat as administrator may be create a shortcut requesting it to be launched as administrator and then execute it:

    <createShortcuts>
        <destination>${installdir}/</destination>
        <shortcutList>
            <shortcut>
                <comment>Run .bat as admin</comment>
                <name>run</name>
                <runAsAdmin>1</runAsAdmin>
                <windowsExec>${installdir}/script/run.bat</windowsExec>
                <windowsExecArgs></windowsExecArgs>
                <windowsPath>${installdir}</windowsPath>
            </shortcut>
        </shortcutList>
    </createShortcuts>
    <runProgram>
       <program>cmd</program>
       <programArguments>/C start /W "" "${installdir.dos}/run.lnk"</programArguments>
    </runProgram>
    

    Could you check if that solves your issue?

Please sign in to leave a comment.