开发者

How to concatenate variables in cmd shell

开发者 https://www.devze.com 2023-01-26 15:31 出处:网络
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 th

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消