0

While on Windows 7, I've created a lot of batch files (.bat) to automate some tasks.

Now that I've moved to a different machine with Windows 10 (we've skipped Win8), I'm having some issues with them.

My domain user was added to the machine's local Administrators Group and I've disabled UAC (just as I had on Win7).

To be able to control Services (net stop, net start), the Command Prompt must be running as Administrator. This can be achieved by setting an advanced property in a shortcut to the batch file (quite annoying since I have many), but it won't work if I want the batch file to run on startup (in the Startup folder of the Start Menu) — the batch file will just not start if "Run as administrator" is set on its shortcut.

I can't seem to find a solution to this problem - what I find is either about Win7, require some additional commands in the batch files (such as runas) or giving rights to specific services. I don't think I had to jump thru any hoops in Win7 for this to work, but it's been a while.

Ƭᴇcʜιᴇ007
  • 111,883
  • 19
  • 201
  • 268
Goozak
  • 181
  • 1
  • 5
  • For #1: See http://superuser.com/questions/71190/running-bat-file-at-startup-as-administrator-in-windows-7, and http://superuser.com/questions/929225/how-to-run-a-program-as-an-administrator-at-startup-on-windows-10?noredirect=1 – Ƭᴇcʜιᴇ007 Dec 01 '16 at 17:53
  • The suggestions for #1 (which is now the only question in my question) all use some tricks to achieve the desired result, which I didn't have to in Win7. – Goozak Dec 09 '16 at 20:52
  • Have you tried to make a self-elevating batch file? Maybe one of these answers may help you http://stackoverflow.com/questions/7044985/how-can-i-auto-elevate-my-batch-file-so-that-it-requests-from-uac-administrator You can also use a self-elevating powershell script, and make it execute the desired bat file, they should run as administrador too. Here are answers on how to do a self-elevating powershell script > http://stackoverflow.com/questions/7690994/powershell-running-a-command-as-administrator – axys93 Dec 09 '16 at 21:08

0 Answers0