string manipulation in command promt
Hi,(command prompt) I want to search for the string "virtual" in "system model" attribute of 'sysinfo' command. The command should be successful if 'virtual' is found in the 'system model: -------------------------' i.e. output of the systeminfo. It should not search for 'virtual' in whole output of systeminfo command but should do in system model attribute only. for command --systeminfo | findstr /i "system model" I will get something like--- System Model: HP Compaq dc7800p Small Form Factor in the above line of the output i want to search for string virtual, and want to manipulate using errorlevel. So please help me to do this. following is the one i tried which was not correct. Or help me if i can use regular expressions systeminfo | findstr /i /R "system model: virtual machine" > nul if %errorlevel% == 0 ( echo virtual machine ) ELSE ( echo physical machine ) Thanks in advance
September 17th, 2012 1:06am

Hi Ramesh, Please avoid duplicated threads. Please continue with Old thread Thanks for understanding. Best Regards,Mohammed Imtiyaz Ali
Free Windows Admin Tool Kit Click here and download it now
September 17th, 2012 2:48am

I m Sorry
September 17th, 2012 3:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics