output command prompt value in a variable

Hi,
I have a .exe at this path C:\Program Files\windows kits\8.1\assessment and deployment kit\deployment tools\x86\licensing\oa30\

after that I type   following command .... oa3tool.exe /validate

Now - how can I catch the output into a variable say-  $HexData for further output ?

ref- http://www.reddit.com/r/sysadmin/comments/31762r/os_imagecloning_help/

thanks
sharepointDepotAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NVITEnd-user supportCommented:
oa3tool.exe /validate > catch.txt
SET /p $HexData=<catch.txt

Open in new window

Bill PrewIT / Software Engineering ConsultantCommented:
What scripting will you be working with, Powershell, DOS, etc?

~bp
sharepointDepotAuthor Commented:
Hi NVIT,
It is saying acess is denied ? see attachment
8.jpg
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

Bill PrewIT / Software Engineering ConsultantCommented:
@sharepointDepot

Your default directory when you ran the oa3tool.exe was under the program files folders, and Windows will typically protect that whole tree from writing for normal users.  You can either run the script in elevated admin mode, or probably better change the temp file location to a writable folder, like:

oa3tool.exe /validate > "%TEMP%\catch.txt"
SET /p $HexData=<"%TEMP%\catch.txt"

~bp
Bill PrewIT / Software Engineering ConsultantCommented:
Also, when you run the oa3tool.exe at a command prompt, what does it display?  Can you paste up a sample of the output?  And then specify exactly what value from the display you want placed in the variable?

~bp
Bill PrewIT / Software Engineering ConsultantCommented:
One more item, on the web page you referenced in your question, there already is a Powershell script that can extract the information from the output and convert it.  Why not use that as is?

~bp
sharepointDepotAuthor Commented:
Hi Guys,
When I run  >>oa3tool.exe /validate - it displays exactly below output
http://www.experts-exchange.com/articles/13637/Where-is-my-Windows-8-Activation-Key.html 

but but but- i need to provide the path of .exe file which is - C:\Program Files\windows kits\8.1\assessment and deployment kit\deployment tools\x86\licensing\oa30\

So after the path-  i can write oa3tool.exe /validate  and will get output, but then i wanted to convert the output into decimal form, for that i wanted to hold it in some variable say $HexData

Thanks
Bill PrewIT / Software Engineering ConsultantCommented:
That seems to be what the powershell script does on the page you originally referenced.  That would be much harder, if not impossible in DOS BAT script, but probably could be done in a VBS script.  

What are you planning to do with the value once you store it in a variable?

~bp
NVITEnd-user supportCommented:
Going the DOS route... this converts your variable $HexData to decimal 1000 and saves to $Dec:

set $HexData=000003E8
set /a $Dec=0x%$HexData%

Open in new window

sharepointDepotAuthor Commented:
Hi,
In the very end MASQ replied his suggestion -how to convert HEX-into key format, it make sense,
that makes a sense,
http://www.experts-exchange.com/articles/13637/Where-is-my-Windows-8-Activation-Key.html

other option is keyfinderplus tool,
thanks makes sense :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sharepointDepotAuthor Commented:
because command prompt didnt run the way it is shown - so finally i directly posted to MSMQ-who is actually written the expert Exchange Article-so he replied-it make much sense, also there is alternate option of KeyFinder Plus tool, which is also helped
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.