Windows 10: Do command when file 3rd-to-last line does NOT contains a string

Discus and support Do command when file 3rd-to-last line does NOT contains a string in Windows 10 Support to solve the problem; I'm having connection issues which I'm documenting. I have a close variant of the following that has 60 seconds in between each call, but I'd like one... Discussion in 'Windows 10 Support' started by DynV, Feb 21, 2021.

  1. DynV Win User

    Do command when file 3rd-to-last line does NOT contains a string


    I'm having connection issues which I'm documenting. I have a close variant of the following that has 60 seconds in between each call, but I'd like one to be continuous until the connection is reestablished. The way I see it, at the end of the following there would be some way of checking the log content and if what's at the end of the log reflect a disconnection and if so immediately make another call.
    and since a good ping should end with something like
    but when the ping goes bad it's like
    , I think the batch last line would be something like if
    ; that's just an example and I'm not good at these kind of things.

    TLDR How to do a command if a file 3rd-to-last line does NOT contains a specific string?

    Thank you kindly for your assistance

    :)
     
  2. Naki Win User

    GPU-Z what command line parameter ?

    Suggestion: /? (-?) and /help (-help) command-line arguments to show a list of all possible arguments in a small window. *Smile Do command when file 3rd-to-last line does NOT contains a string :)
     
  3. ryanly Win User
    GPU-Z what command line parameter ?

    Current /? (-?) or / help (-help) parameter is invalid
     
    ryanly, Feb 21, 2021
    #3
  4. Do command when file 3rd-to-last line does NOT contains a string

    Deleting Lines in a Text File Given Strings From Another File Using Set-String (Powershell)

    Basically what's happening is that I have two files, one with a list of allowed users and another list of users that are actually on the desktop. What I'm trying to do is use a for loop to grab each name in the AllowedUsers.txt file, and use Select-String
    to find any names that match and delete them from the original Users.txt (with the list of users actually on the desktop). The end goal is to have a list of users that aren't allowed on the desktop left in the Users.txt file, where I can then for loop through
    once again and simply delete those users through command line.

    Unfortunately, I have been unable to get this to work as I don't fully grasp how Select-String or for loops work, but any help writing the script would be greatly appreciated.
     
    BassoftheC, Feb 21, 2021
    #4
Thema:

Do command when file 3rd-to-last line does NOT contains a string

Loading...
  1. Do command when file 3rd-to-last line does NOT contains a string - Similar Threads - command file 3rd

  2. how to send text string by command line through bluetooth connection?

    in Windows 10 Gaming
    how to send text string by command line through bluetooth connection?: I am trying to establish bluetooth communication between my computer and an application that I am developing, installed on an android tablet. How can I send data from my computer to my application to check if the communication is successful?...
  3. how to send text string by command line through bluetooth connection?

    in Windows 10 Software and Apps
    how to send text string by command line through bluetooth connection?: I am trying to establish bluetooth communication between my computer and an application that I am developing, installed on an android tablet. How can I send data from my computer to my application to check if the communication is successful?...
  4. Command line commands

    in Windows 10 Customization
    Command line commands: I would like to create a shortcut on the desktop using a command in a .bat file. I would like to specify what icon file to use, what program to execute, and the parameters to pass to the program. I have researched MKLINK but I don't think it will do the job. Any...
  5. Command Line

    in Windows 10 Network and Sharing
    Command Line: I am attempting to copy and entire directory from one HDD to another, by keep getting an error of "Invalid umber of parameters." The file path to the Directory is as follows: G:\Users\USERNAME\Desktop\OLD OS FOLDER The destination folder is C:\OLDOS Can someone PLEASE...
  6. Deleting files with command line

    in Windows 10 Network and Sharing
    Deleting files with command line: I used del filename and it was successfully deleted. I also used dir to double check. However, when I checked the Recycle Bin; the file wasn't found inside. Was this file permanently deleted?...
  7. Can my program determine the command line string?

    in Windows 10 Software and Apps
    Can my program determine the command line string?: My programming language of choice (Object Rexx) can determine the Process ID. But it cannot tell me the full command line expression, just the parameters passed. Is there a Windows utility/program that can display the Command Line? Process Explorer displays the Command Line...
  8. Deleting Lines in a Text File Given Strings From Another File Using Set-String (Powershell)

    in AntiVirus, Firewalls and System Security
    Deleting Lines in a Text File Given Strings From Another File Using Set-String (Powershell): Basically what's happening is that I have two files, one with a list of allowed users and another list of users that are actually on the desktop. What I'm trying to do is use a for loop to grab each name in the AllowedUsers.txt file, and use Select-String to find any names...
  9. Running a Command Line Command From a File Automatically

    in Windows 10 Installation and Upgrade
    Running a Command Line Command From a File Automatically: I have the following commands which need to be run in the command line: sc.exe config wuauserv start= disabled sc.exe stop wuauserv I want to create a file which, when launched, opens the command line, sends the above commands to the command line, and then closes the...
  10. Bash window and last command line after CU

    in Windows 10 Software and Apps
    Bash window and last command line after CU: After creators update, bash window does not update last command. ie .bash_history not getting updated. Any reason? Any way to solve it? 84780