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. 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...
  3. Command Line

    in Windows 10 Ask Insider
    Command Line: My command line shows a different name when im the only user on the pc. submitted by /u/Fuadop [link] [comments] https://www.reddit.com/r/Windows10/comments/hv4f7i/command_line/
  4. 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?...
  5. WSL does not show a command line prompt.

    in Windows 10 BSOD Crashes and Debugging
    WSL does not show a command line prompt.: Hi, I have trouble starting WSL. The window opens, but I cannot type anything. It is showing a black/blue window with a blinking prompt. I rebooted my system and it still doing that. Any idea how to fix this?...
  6. 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...
  7. 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...
  8. Command Line

    in Windows 10 Network and Sharing
    Command Line: Hello sir. I am using windows 10 64bit. Earlier the netsat command use to work but it doesnt work now. whenever i try this command it displa an error. C:\>netstat 'netstat' is not recognized as an internal or external command, operable program or batch file. i have tried...
  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