However, in this situation, we don’t have an input text file but the output of another command. It takes the input text file and processes it line by line. The command processor has the FOR command. If you’re in doubt how this script works, you can find detailed explanation in the following section. If you execute it from the command prompt, you will see the output as x86 or 圆4. Here is a simple script that demonstrates today’s topic: offįor /f "usebackq tokens=1,2 delims=,=- " %%i in (`wmic computersystem list full`) do %%i=SystemType set platform=%%j find a desired value in a certain part of the line (or a virtual column).split the contents of each line into several parts, and.Whenever we have such a structured file, we can easily manipulate the data in it. In each row, we have the parameter name, equal sign and the current value of that parameter. If we execute the wmic command directly from the command prompt, we will see that its output is structured. The answer to this problem is to execute the wmic command and filter its output. In addition, it must be usable on any Windows version, starting from Windows 7/2008. My batch file should somehow automatically read on which platform it’s running and to execute the appropriate part of the file. I need to execute the same batch file on Windows 32 and 64-bit systems.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |