I would like to know how I could achieve this, I tried few times with no luck.. I get a syntax error
I need to write a batch file to read the first line of a text, assign to a variable and then compare with a string.
bool.txt:
开发者_运维百科Hello
test.bat:
set  Variable =< C:\bool.txt
if "%Variable%"=="Hello"
echo I am here
Thanks in advance SR
see help for and help set and then try this
 for /f %%a in (bool.txt) do (
     if "%%a"="Hello" echo I am here
 )
You have an extra space after the variable name, therefore you're not setting the variable %Variable% but %Variable %.
Use
set /p Variable=< bool.txt
instead.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论