| 1. |
Solve : Setting a variable? |
|
Answer» Hi I am a little NEW to DOS programming and am trying to set a certain commands result to a variable Hi I am a little new to DOS programming and am trying to set a certain commands result to a variable May I clarify? You want to run this command Quote openssl base64 -d -in out.txt -out temp.txt This command will place some text into a text file called temp.txt. Do you then wish to place the CONTENTS of temp.txt into a variable? So that (eg) echo %VAR% would show the one line of temp.txt? Is that correct? If the answer to the above question is "yes", you could try this Quote openssl base64 -d -in out.txt -out temp.txt Also, please do not write "HELP ANYONE!!!!!". This is considered to be bad manners. It is like shouting at people. It will not get you an answer faster. I apologize. Being rude or ill mannered was not my intention in the least. as to your answer to my post, is there anyway i could do this without writing to a file at all and simply save the result in an environment variable. Thank youI am not familiar with the openssl command. If an -out file is not specified, does the output APPEAR on the screen? yes it doesThen this might work Quote setlocal enableextensions If the decrypted text still appears on screen, try this alteration Quote for /F "delims= " %%L in ('openssl base64 -d -in out.txt>nul') do set VAR=%%L Thank you so much Ive been stuck on this one for a while (New to DOS). Worked like a charmI'm sorry I shouted at you before! You may not need this line Quote setlocal enabledelayedexpansion |
|