How to concatenate variables in cmd shell
I am writing a cmd script. Part of what I have to do requires me to concatenate the values of two variables. I've created开发者_高级运维 a variable called %mydate%, and I would like to concatenate that with a space and the value of the system variable %time%.
I've tried set mydate2 = %mydate% %time%
, but it is null.
Any ideas?
TIA!
This works for me:
set mydate2=%date% %time%
Note: %date% and %time% are just examples - they are created by the interpreter and thus always exist.
精彩评论