nils-soderman / vscode-batch-runner

Visual Studio Code extension to run batch files in the terminal
https://marketplace.visualstudio.com/items?itemName=NilsSoderman.batch-runner
MIT License
5 stars 5 forks source link

Support running scripts as admin #4

Closed GarrettCarter-eaton closed 2 years ago

GarrettCarter-eaton commented 2 years ago

My workflow involves running batch scripts as admin.

Perhaps you could add this as a global toggle "Run all scripts as admin" or... Add an additional right click option "Run this script as admin"

nils-soderman commented 2 years ago

Hi,

I've now published v0.0.7 where I added the command batch-utils.execBatchFileAsAdmin.

There are several way to execute a batch file as admin, will probably document this in the ReadMe later on:

  1. If you hold down Alt while right clicking a file in the explorer, you'll get the option to run it as admin
  2. There's now a dropdown next to the run icon where you can set it to run as admin: image

or you could always map the command to a hotkey / just run the command from Ctrl + Shift + P.

Thank you for the idea/feedback and let me know if you run into any issues using it!

Cheers, Nils