How to ensure that bat file is run as Administrator?

martienne

New Member
Member
Messages
128
Location
European Union
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 Computer

System One

  • OS
    Win 8.1
    Computer type
    PC/Desktop
    CPU
    i5
    Motherboard
    ASUS
    Memory
    24 GB DDRAM3
    Graphics Card(s)
    NVIDIA GT430 x2
    Sound Card
    Audial
    Monitor(s) Displays
    2 x 28" Sharp
    Screen Resolution
    1360 x 768
    Hard Drives
    Samsung, Seagate, Toshiba, Hitachi, Western Digital
    PSU
    750 watt
    Cooling
    liquid closed
Task manager.

screenshot_70.jpg

screenshot_70.jpg
 

My Computer

System One

  • OS
    Windows 8.1.1 Pro with Media Center
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Gateway
    CPU
    AMD K140 Cores 2 Threads 2 Name AMD K140 Package Socket FT1 BGA Technology 40nm
    Motherboard
    Manufacturer Gateway Model SX2110G (P0)
    Memory
    Type DDR3 Size 8192 MBytes DRAM Frequency 532.3 MHz
    Graphics Card(s)
    ATI AMD Radeon HD 7310 Graphics
    Sound Card
    AMD High Definition Audio Device Realtek High Definition Audio USB Audio Device
    Monitor(s) Displays
    Name 1950W on AMD Radeon HD 7310 Graphics Current Resolution 1366x768 pixels Work Resolution 1366x76
    Screen Resolution
    Current Resolution 1366x768 pixels Work Resolution 1366x768 pixels
    Hard Drives
    AMD K140
    Cores 2
    Threads 2
    Name AMD K140
    Package Socket FT1 BGA
    Technology 40nm
    Specification AMD E1-1200 APU with Radeon HD Graphics
    Family F
    Extended Family 14
    Model 2
    Extended Model 2
    Stepping 0
    Revision ON-C0
    Instruction
    Browser
    Opera 24.0
    Antivirus
    Avast Internet Security
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 Computer

System One

  • OS
    Win 8.1
    Computer type
    PC/Desktop
    CPU
    i5
    Motherboard
    ASUS
    Memory
    24 GB DDRAM3
    Graphics Card(s)
    NVIDIA GT430 x2
    Sound Card
    Audial
    Monitor(s) Displays
    2 x 28" Sharp
    Screen Resolution
    1360 x 768
    Hard Drives
    Samsung, Seagate, Toshiba, Hitachi, Western Digital
    PSU
    750 watt
    Cooling
    liquid closed
The script must be run by the Task [DEL]Manager[/DEL] Scheduler . It cannot be run elevated from the startup folder.

Edit: Sorry, I meant Scheduler.


Create a task for it.
 
Last edited:

My Computer

System One

  • OS
    Windows 8.1 Pro x64 with Media Center, Windows 10 Pro x64, Windows 7 x64 Ultimate SP1
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Custom System
    CPU
    INTEL Xeon E5-2670 LGA 2011
    Motherboard
    Gigabyte GA X79 UD5 v1.0 F13s
    Memory
    64GB (8 X 8 GB) G-Skill Ripjaws Z DDR3 2133 Quad Channel
    Graphics Card(s)
    EVGA GTX 1060 SC 3 GB
    Sound Card
    Realtek Onboard ALC898
    Monitor(s) Displays
    2 x Samsung S27E310
    Screen Resolution
    1920 x 1080
    Hard Drives
    Samsung 850 PRO 256 GB SSD
    1 x 6TB WD 6003FZBX SATA
    13 x 3TB WD 30EFRX SATA
    PSU
    Seasonic X-1050
    Case
    Thermaltake Armor+
    Cooling
    INTEL BXRTS2011LC Liquid-cooled
    Keyboard
    Logitech G510s
    Mouse
    Microsoft Wireless Explorer Mouse
    Internet Speed
    7.0 Mb/s
    Browser
    IE 11, Chrome
    Antivirus
    ESET NOD32 11.1, Malwarebytes Pro 3.5.1
    Other Info
    ASUS RT-AC68U router
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 :cool:
 

My Computer

System One

  • OS
    Windows 7 HP 64bit, Windows 8.1 Pro w/Media Center 64BIT
    Computer type
    PC/Desktop
    System Manufacturer/Model
    ASUS - Home Built
    CPU
    AMD Phenom II X6 1100T
    Motherboard
    ASUS M5A99X EVO
    Memory
    Crucial Balistic DDR-3 1866 CL 9 (8 GB)
    Graphics Card(s)
    MSI R6850 Cyclone IGD5 PE
    Sound Card
    On Chip
    Monitor(s) Displays
    ASUS VE258Q 25" LED with DVI-HDMI-DisplayPort
    Screen Resolution
    1920 x 1080
    Hard Drives
    Two WD Cavier Black 2TB Sata 6gbs
    WD My Book Essential 2TB USB 3.0
    PSU
    Seasonic X650 80 Plus GOLD Modular
    Case
    Corsair 400R
    Cooling
    Antec Kuhler H2O 620, Two 120mm and four 140mm
    Keyboard
    AVS Gear Blue LED Backlight
    Mouse
    Logitech Marble Mouse USB, Logitech Precision Game Pad
    Internet Speed
    15MB
    Antivirus
    NIS, Malwarebytes Premium 2
    Other Info
    APC UPS ES 750, Netgear WNR3500L Gigabit & Wireless N Router with SamKnows Test Program,
    Motorola SB6120 Gigabit Cable Modem.
    Brother HL-2170W Laser Printer,
    Epson V300 Scanner
Perhaps Task Scheduler:

Screenshot (120).png

Screenshot (121).png

Screenshot (122).png

Screenshot (123).png

Screenshot (124).png

Screenshot (125).png

Screenshot (126).png

Screenshot (127).png

Or as others above have suggested. :)
 

My Computer

System One

  • OS
    Windows 8.1.1 Pro with Media Center
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Gateway
    CPU
    AMD K140 Cores 2 Threads 2 Name AMD K140 Package Socket FT1 BGA Technology 40nm
    Motherboard
    Manufacturer Gateway Model SX2110G (P0)
    Memory
    Type DDR3 Size 8192 MBytes DRAM Frequency 532.3 MHz
    Graphics Card(s)
    ATI AMD Radeon HD 7310 Graphics
    Sound Card
    AMD High Definition Audio Device Realtek High Definition Audio USB Audio Device
    Monitor(s) Displays
    Name 1950W on AMD Radeon HD 7310 Graphics Current Resolution 1366x768 pixels Work Resolution 1366x76
    Screen Resolution
    Current Resolution 1366x768 pixels Work Resolution 1366x768 pixels
    Hard Drives
    AMD K140
    Cores 2
    Threads 2
    Name AMD K140
    Package Socket FT1 BGA
    Technology 40nm
    Specification AMD E1-1200 APU with Radeon HD Graphics
    Family F
    Extended Family 14
    Model 2
    Extended Model 2
    Stepping 0
    Revision ON-C0
    Instruction
    Browser
    Opera 24.0
    Antivirus
    Avast Internet Security
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 :cool:

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

screenshot_70.jpg
 

My Computer

System One

  • OS
    Windows 8.1.1 Pro with Media Center
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Gateway
    CPU
    AMD K140 Cores 2 Threads 2 Name AMD K140 Package Socket FT1 BGA Technology 40nm
    Motherboard
    Manufacturer Gateway Model SX2110G (P0)
    Memory
    Type DDR3 Size 8192 MBytes DRAM Frequency 532.3 MHz
    Graphics Card(s)
    ATI AMD Radeon HD 7310 Graphics
    Sound Card
    AMD High Definition Audio Device Realtek High Definition Audio USB Audio Device
    Monitor(s) Displays
    Name 1950W on AMD Radeon HD 7310 Graphics Current Resolution 1366x768 pixels Work Resolution 1366x76
    Screen Resolution
    Current Resolution 1366x768 pixels Work Resolution 1366x768 pixels
    Hard Drives
    AMD K140
    Cores 2
    Threads 2
    Name AMD K140
    Package Socket FT1 BGA
    Technology 40nm
    Specification AMD E1-1200 APU with Radeon HD Graphics
    Family F
    Extended Family 14
    Model 2
    Extended Model 2
    Stepping 0
    Revision ON-C0
    Instruction
    Browser
    Opera 24.0
    Antivirus
    Avast Internet Security
Back
Top