Search found 2 matches

by vaschthestampede
2023-Dec-27, 5:05 pm
Forum: Windows CMD Shell
Topic: Save command result in a variable
Replies: 1
Views: 3837

Re: Save command result in a variable

I foud a solution:

Code: Select all

for /F "delims=" %A in ('dism /Online /Get-Capabilities ^| findstr "OpenSSH.Server"') do set "AAA=%A"
by vaschthestampede
2023-Dec-22, 12:05 pm
Forum: Windows CMD Shell
Topic: Save command result in a variable
Replies: 1
Views: 3837

Save command result in a variable

Hi everyone, I'm new here and I hope I find myself well. Trying to automate processes I have difficulty saving the result of a command in a variable. The only way I've found is to save it to a file first and then load it: dism /Online /Get-Capabilities | findstr "OpenSSH.Server" > AAA.txt ...