Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: How to run a batch , .bat, flle as administrator

06 Oct 2013   #11
Layback Bear

Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64

Just a thought.
Do you have a option for Systems to have full permission.

My System SpecsSystem Spec
07 Oct 2013   #12

W7 Ultimate SP1, LM18.3 MATE, W10 Home, #All 64 bit
Administrators Group != Administrator

Quote   Quote: Originally Posted by blockie View Post
3. William is an Administrater. But I will change it tomorrow. I also have a everyone user with full privilege.
Human users (i.e. you and me) don't get "full administrator power", even though Windows says we are in the Administrators Group.

The built-in Administrator (i.e. Username: "Administrator") has more power.

On my PC, I'm an administrator and I have received the "You don't have permission to do this. Contact the Administrator" message, when I have been attempting to perform operations.
Though the last time was so long ago that I can't remember what I was trying to do.
My System SpecsSystem Spec
07 Oct 2013   #13

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM

Try changing the user to SYSTEM and see if the task works the way you want.

How to run a batch , .bat, flle as administrator-msesp01.png

My System SpecsSystem Spec

12 Oct 2013   #14


Thanks to everyone, But on further investigation of Macrium Reflect, I found that I could put an option in the vmx file that deleted old backups automatically. So this thread becomes not solved but not needed.
My System SpecsSystem Spec
08 Dec 2014   #15

Windows 7 64bit

Sorry to resurrect this old thread, but I am dealing with the exact same problem. I have followed each item in the previous posts, but no luck.

I do have one more piece of information, though. When I remove the the argument to run the batch file in Task Scheduler the CMD window will open as Administrator. When I add the argument back it will not open as Administrator.

Can anyone provide insight into this problem?

Much Thanks.
My System SpecsSystem Spec
08 Dec 2014   #16

Windows 7 Pro 32

Try with this test batch file. It only prints 2 things, if it's running as administrator or not, and the parameters.

    ECHO Administrator=YES
) ELSE (
    ECHO Administrator=NO
IF [%1]==[] GOTO CONT
IF [%COUNT%]==[1] (
    set PARAMS=%1
) ELSE (
    set PARAMS=%PARAMS% %1
echo Parameters: %PARAMS%
When I try to run it from Task Scheduler as admin(Run with highest privileges) and arguments: param1 param2
Parameters: param1 param2

Press any key to continue . . .

Also test if the option "Run only when user is logged on" makes a difference.
My System SpecsSystem Spec
09 Dec 2014   #17
Mikkel Birtilid

Windows 8.1 x64-bit, Ubuntu 14.04

I made a a batch file.
I called it test.bat when I saved it.
Then I create a shortcut of the real test.bat so I have a test.bat - Shortcut
I then Right-click on the test.bat - Shortcut and then I choose properties and then I select advanced in the properties section.
When you have done that there will be a new box you can mark as "Run as administrator".

Try that for starters.
My System SpecsSystem Spec
09 Dec 2014   #18

Windows 7 64bit

Mikkel, thanks for the reply. I tried that, but the batch file is to be run unattended so I will not be around to accept the UAC message.

I can't modify the batch file. Also it looks like it requires user interaction, which needs to be avoided.

My System SpecsSystem Spec
09 Dec 2014   #19

Windows 7 Pro 32

@bender123, I meant you could add a new scheduled task with this test file to see if that works. It works for me so if it works for you too then it's probably an issue with your other batch file or the properties of its scheduled task. This will verify if it's possible from a scheduled task to start a batch file with parameters as administrator.

It doesn't require interaction. The "pause" is there only so you can verify the output, but you could just close the window. It's just a one-time test, nothing you should keep.
The troubleshooting for your issue has to start somewhere and this was my idea for starting point.
My System SpecsSystem Spec
09 Dec 2014   #20

Windows 7 64bit

Thanks, Tookeri!

I misunderstood the purpose of your script. I do see a difference in the output when I select/deselect "Run with highest privileges".

I just realized when my Scheduled Task is run it uses taskeng.exe and not cmd.exe. Maybe there is a difference in the way these applications display the privileges?
My System SpecsSystem Spec

 How to run a batch , .bat, flle as administrator

Thread Tools

Similar help and support threads
Thread Forum
UAC - Batch Files just Blink (Do Nothing) when Run-as-Administrator
If the following is true: 1. A batch file resides in a path that is unprotected by windows like C:\Temp or D:\Anything, and, 2. any of the folders in the path, or the name of the batch file, contain the "(" opening parenthesis, and, 3. the batch file is run by clicking/selecting...
System Security
How do I make this Batch run as Administrator by default?
I haven't looked back since recently and initially reluctantly upgrade from XP to Windows 7. Just loving it now. But I have a small BATCH file problem. I found and adapted a batch file (see below) to start the VAG parts catalogue program after first resetting the system date but then...
Can no longer run batch files unless as administrator
Windows 7 64-bit Home Premium - Dell 660 w/i5 Intel - 8GB RAM I've been running the same batch files for several years with the same login account. Now, all of a sudden, I have to run them as administrator. My personal account already is an 'administrator' and not a standard user account. ...
General Discussion
How to always run batch file as administrator?
I've made a batch file, but i don't know how to make it to always run as administartor. In .bat's file properties the option "always run as administartor" is grayed out. I have to right click it and then choose "run as administartor" from context menu. But i don't want to do it every time because...
General Discussion
batch files - run as administrator
I am a software developer (dot net). Until recently I did all my work in the XP environment. I developed a utility library that goes into the global assembly cache. In the XP world this was easy. I write some .bat files that called the gacutil.exe and passed it the appropriate parameters. ...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 18:00.
Twitter Facebook Google+