question

ecat-1993 avatar image
0 Votes"
ecat-1993 asked Viorel-1 commented

some questions about cmd

if i use the command : cmd /c “set x=c@alc & echo %x:@=% | cmd”
it is ok, it will start the calc
but if i use the commmand : cmd /c "set a=ipconfig"
and i try to run : %a%
it is failed, i found it is not to set the a

how can i set a=ipconfig by use cmd /c

windows-api
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Do you want a to contain the "ipconfig" string or the output of ipconfig command?



0 Votes 0 ·

1 Answer

Castorix31 avatar image
0 Votes"
Castorix31 answered

You can do for example :

 cmd /c "set a=ipconfig && cmd /c ^"echo %a%^" | cmd"  
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.