0
cscript //nologo versioninfo.vbs Kernel Kernel\bin\Release\Kernel.exe

This script returns me a version of my Kernel file. Let's say 3.11

Now I want to create a directory containing that 3.11.

set version=cscript //nologo versioninfo.vbs Kernel Kernel\bin\Release\Kernel.exe

set destination=\MyProgram(%version%)

if not exist %destination% mkdir %destination%

but it doesn't create it with the name

MyProgram(3.11)

as expected but creates as

MyProgram(cscript //nologo versioninfo.vbs Kernel Kernel\bin\Release\Kernel.exe)

So I need my cscript output set as a text so I could just insert it into my destination.

Solution:

cscript //nologo versioninfo.vbs Kernel Kernel\bin\Release\Kernel.exe > tmp
SET /p version= < tmp
Wkjjjj
  • 45
  • 1
  • 8
  • 1
    Possible duplicate of [How do I get the result of a command in a variable in windows?](http://stackoverflow.com/questions/108439/how-do-i-get-the-result-of-a-command-in-a-variable-in-windows) – aschipfl Nov 02 '16 at 11:11

1 Answers1

0

Found the solution

cscript //nologo versioninfo.vbs Kernel Kernel\bin\Release\Kernel.exe > tmp SET /p version= < tmp

Wkjjjj
  • 45
  • 1
  • 8