k2k 5 Posting Whiz

this is perfectly fine. It will grep each of the output, if it != "client" or "-----" then it will be written to the text file.

for /F "tokens=3" %%a in ('E:\things\bpplclients') do (    
        if /I not "%%a" == "Client" (
       if /I not "%%a" == "--------------" (
            echo %%a >> %userprofile%\desktop\clientInfo.txt   

however...

for /F "tokens=3" %%a in ('E:\things\bpplclients') do ( 
        set hn="%%a"   
        if /I not "%hn%" == "Client" (
       if /I not "%hn%" == "--------------" (
            echo %hn% >> %userprofile%\desktop\clientInfo.txt   
                                         )
                                 )

This will output "" instead of the value of variable %hn%...

How do i correctly set variable and be able to use the variable at a latter time. I wish it is as straight forward as bash or any other languages....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.