Windows 8 and 8.1 Forums


How to ensure that bat file is run as Administrator?

  1. #1

    How to ensure that bat file is run as Administrator?


    I have a bat file that makes sure that DNS settings are correct, at startup, since Win 8 has a tendency to drop them.
    How can I ensure that the bat file is run in an elevated prompt? It doesn't execute unless it is...?

      My System SpecsSystem Spec

  2. #2


    Harrisonburg, Va.
    Posts : 10,488
    Windows 8.1.1 Pro with Media Center


    Task manager.

    Click image for larger version

    Click image for larger version
      My System SpecsSystem Spec

  3. #3


    Thanks! However, this is a script that I put in the Startup folder, so the idea is that it is supposed to run automatically. But right now, it doesn't work, due to the fact that it opens in a regular command prompt by default, not an elevated.

    How to do I get it to run automatically in elevated mode?
    My user is Administrator on the machine, so I don't quite know why that doesn't happen to begin with, but it doesn't.
      My System SpecsSystem Spec

  4. #4


    Florida, USA
    Posts : 141
    Windows 8.1 Pro x64 with Media Center, Windows 10 Pro x64, Windows 7 x64 Ultimate SP1


    The script must be run by the Task Manager Scheduler . It cannot be run elevated from the startup folder.

    Edit: Sorry, I meant Scheduler.


    Create a task for it.
    Last edited by pbcopter; 27 May 2014 at 11:53.
      My System SpecsSystem Spec

  5. #5


    Covington, La
    Posts : 1,184
    Windows 7 HP 64bit, Windows 8.1 Pro w/Media Center 64BIT


    I have a bat file that I made a shortcut and under the shortcut Properties/Shortcut/Advanced you can select to run as Administrator, then put the shortcut in the Startup folder.

    Jim
      My System SpecsSystem Spec

  6. #6


    Harrisonburg, Va.
    Posts : 10,488
    Windows 8.1.1 Pro with Media Center


    Perhaps Task Scheduler:

    Click image for larger version

    Click image for larger version

    Click image for larger version

    Click image for larger version

    Click image for larger version

    Click image for larger version

    Click image for larger version

    Click image for larger version

    Or as others above have suggested.
      My System SpecsSystem Spec

  7. #7


    Harrisonburg, Va.
    Posts : 10,488
    Windows 8.1.1 Pro with Media Center


    Quote Originally Posted by Phone Man View Post
    I have a bat file that I made a shortcut and under the shortcut Properties/Shortcut/Advanced you can select to run as Administrator, then put the shortcut in the Startup folder.

    Jim
    This seems to be the easiest option.
    I just tried it & it works.

    Click image for larger version
      My System SpecsSystem Spec

How to ensure that bat file is run as Administrator?
Related Threads
My administrator account isn't really an administrator in User Accounts and Family Safety
I have only one account on my computer, and it's an administrator account. However, I still have the "run as admin" option in the context menu. How come? Often I get issues when running installations, because they don't have the necessary permissions until I run them as admin. But Windows...
I am getting error "Save failed - Please check if this file is opened in another program" when trying to edit the hosts file in Notepad++. This has only started happening after a fresh installation of Windows 8 on a new computer. My previous computer with Windows 8.1 was able to do it correctly...
In Windows 8.1, when I try to use the native ISO mounting function, either from the right-click menu, or by double clicking the iso file, I am getting the error: Couldn't Mount File Sorry, there was a problem mounting the file. Yet most of the time, the virtual CD/DVD drive appears as it ...
Hi guys1 I'm about to create a .reg file that will set path in registry to my own icon for specific file extensions. E.g. I want my own icon as a default icon for .ini extension. And not only for one extension but for more of them, in a single .reg file. As always I don't want to mess it up,so I'm...
Guest Account File Saving and File Details in User Accounts and Family Safety
I would like a friend to be able to use my guest account to create occasional word documents etc. Could he save files to the computer and, if so, what would the produced and saved by details boxes in the properties information say? I cannot check this myself now, as I have had problems arising from...
How to Restore Previous Versions of your Files with File History in Windows 8 and 8.1 File History is a new feature introduced in Windows 8 that automatically backs up files that are in your libraries, contacts (C:\Users\(user-name)\Contacts), Internet Explorer favorites...
Ok, I don't know how I did it but I got both Windows 7 File Recovery and Windows 8 File History active at the same time. I upgraded from Win 7 to 8 Pro and transferred settings so win 7 file recovery was already active, when I tried to turn on win 8 file recovery I got a message saying I cant...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook