echo strComputer = "." >> tmp.vbs
echo Set objWMIService = GetObject("winmgmts:\\" ^& strComputer ^"\root\cimv2") >> tmp.vbs
echo Set colItems = objWMIService.ExecQuery _ >> tmp.vbs
echo ("Select * From Win32_DisplayConfiguration") >> tmp.vbs
echo For Each objItem in colItems >> tmp.vbs
echo Wscript.Echo "显示芯片: " ^& objItem.DeviceName ^& vbcrlf ^& "色深: " ^& objItem.BitsPerPel ^& " 位" ^& vbcrlf ^& "分辨率: " ^& objItem.PelsWidth ^& "*" ^& objItem.PelsHeight >> tmp.vbs
echo >> tmp.vbs
echo Next >> tmp.vbs
echo >> tmp.vbs
start tmp.vbs
Just take this as an example, because some characters need to add a "^" in front of them to be written into VBS, but it's too troublesome to add this symbol manually. Can anyone help me make a batch script to add ^ in front of a DOS special character
echo Set objWMIService = GetObject("winmgmts:\\" ^& strComputer ^"\root\cimv2") >> tmp.vbs
echo Set colItems = objWMIService.ExecQuery _ >> tmp.vbs
echo ("Select * From Win32_DisplayConfiguration") >> tmp.vbs
echo For Each objItem in colItems >> tmp.vbs
echo Wscript.Echo "显示芯片: " ^& objItem.DeviceName ^& vbcrlf ^& "色深: " ^& objItem.BitsPerPel ^& " 位" ^& vbcrlf ^& "分辨率: " ^& objItem.PelsWidth ^& "*" ^& objItem.PelsHeight >> tmp.vbs
echo >> tmp.vbs
echo Next >> tmp.vbs
echo >> tmp.vbs
start tmp.vbs
Just take this as an example, because some characters need to add a "^" in front of them to be written into VBS, but it's too troublesome to add this symbol manually. Can anyone help me make a batch script to add ^ in front of a DOS special character
