0

Could i do something like this without the type command? or with it but i need to store text from a txt file to a %variable% like

set thing=type C:\something\code.txt

But the problem is that the variable is "Type C:\something\code.txt" not like "hi this is text" from the code.txt please answer if you know any kind of way to do this thx

example

set serialkey=X234-2345
set yourserialkey=type "C:\something\code.txt"
if %yourserialkey%==serialkey goto success
exit
:success
echo hi!
pause
exit
  • 1
    I think the question is unclear and doesn't make much sense unless you illustrate it with an example. – wOxxOm Nov 21 '15 at 17:26
  • Check my answer here - i set output of java command as variable. If you substitute the java call with the type you might get somewhere http://stackoverflow.com/questions/33640331/sqlserver-connection-with-windows-authentification-in-32-and-64-bit-environment/33805610#33805610 – Jan Nov 21 '15 at 17:36
  • 5
    `set /P "yourserialkey=" < "C:\something\code.txt"` – Aacini Nov 21 '15 at 17:48
  • @Aacini Thank you so much!! thats exactly what i was looking for! –  Nov 26 '15 at 13:47

0 Answers0