Share via

some questions about cmd

ecat 0 Reputation points
2021-08-09T02:08:33.723+00:00

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 for home | Windows 11 | Apps

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Castorix31 91,876 Reputation points
    2021-08-09T06:17:28.32+00:00

    You can do for example :

    cmd /c "set a=ipconfig && cmd /c ^"echo %a%^" | cmd"  
    

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.