![]() The token number may be less obvious, since there are several spaces before the first word. Multiple spaces are still treated as a single delimiter.Ī row of characters in the delims definition is interpreted as "the first character OR the second character OR the third character" etcetera, so you can only use multiple single characters as delimiters in the delims definition, not entire "words". The choice for delims will be obvious: a space. Reply from 10.100.0.14: bytes=32 time UNIQUE Registered Will return something like: Pinging REMOTE_PC with 32 bytes of data: We'll use PING to convert the IP address to its associated computer name: PING -a 10.100.0.14 -n 1 -w 500 So if we know the remote PC name we know which line to filter out: REMOTE_PC UNIQUE Registered Note the lower case -a ( NBTSTAT /? will show you the syntax in detail). That's why we'll add another step: NBTSTAT -a REMOTE_PC However, since we started with an IP address, in this case there is no way to distinguish between a computer name and a user name. We obviously need the information from the line that contains the string but not the line with the computer name: REMOTE_PC UNIQUE Registered Will return something like: Local Area Connection: Using an example, we are going to try and find a way to define values for tokens and delims.įor our example, we are going to find out who is logged on to a computer with a specified IP address (like, say, one found in our firewall logs). ![]() ![]() The general syntax of FOR /F commands, at least the part we are going to analyze, is: FOR /F "tokens= n,m* delims= ccc" %%A IN (' some_command') DO other_command %%A %%B %%C VoltCraft Energy Logger 3500 Configuration. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |