for loop working in CMD prompt but not in batch file - for loop was copy pasted

前端 未结 1 483
轻奢々
轻奢々 2021-01-12 11:56

Note: I have almost no idea at all how batch file \'for\' loops work.

The batch file I have currently:

\"C:\\Program Files (x86)\\HMA! Pro VPN\\bin\         


        
相关标签:
1条回答
  • 2021-01-12 12:22

    In a batch file you have to use two percents for FOR parameters, that's all

    for /f "usebackq tokens=1,2,3,*" %%A in (`netsh interface show interface`) do (
        if "%%D"=="Local Area Connection 2" set state=%%B
    )
    
    0 讨论(0)
提交回复
热议问题