5

i'm creating a batch file to show my current power plan i'm using this command:

powercfg -getactivescheme

it shows the result like this:

Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c  (High performance)

i want to hide the power plan code so it only shows:

(High performance)

any help is appreciated :D thanks!

0

1 Answer 1

6

Use the standard parse-loop:

for /f "delims=() tokens=2" %%a in ('powercfg -getactivescheme') do set name=%%a
echo Name: (%name%)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.