Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: ask for help to crate batch script to judge which program occupy specified port  (Read 2823 times)

0 Members and 1 Guest are viewing this topic.

crest.boy

    Topic Starter


    Rookie

    • Experience: Beginner
    • OS: Windows XP
    Hi friends,

    I'd like to get a batch script to accept one argument indicating port number and the output of the script is the program name which currently occupies the port. Just like:

    input: demo.bat 80
    output: firefox.exe
    question: what scripts should be implemented in demo.bat?

    Could you please do me a favor?

    Thanks in advance!!

    terrylangley

    • Guest

    Salmon Trout

    • Guest
    And that helps how exactly, terrylangley?

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    I'd download and use http://www.mcafee.com/us/downloads/free-tools/fport.aspx FPORT with /a switch (/a sort by application) and pass the Firefox.exe application switch to it, you then can use batch to use the output  and parse it as needed to perform other tasks or just >>write_output_to_file.txt in which other programs can read in the txt file and run routines that batch may not be able to perform.

    Great link on parsing with batches: http://ss64.com/nt/for_f.html