Results 1 to 7 of 7

Thread: Executing a bat file from php?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448

    Executing a bat file from php?

    Is there a way to execute or do the same thing as what a bat file does? I would like to use ping in command but am not allowed to use it from where i am accessing the web site. So is there a way to exec cmd from where the server is if its on windows or from the client? Thanks for the help.

  2. #2
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    might not beable to. try exec("file.bat") but if that doesn't work php has some built in functions that check dns.

    look into checkdnsrr() or gethostbyaddr() or gethostbyname(), gethostbynamel()

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    will those tell me the latency of the ips?

  4. #4
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    it will return true if valid and false if nothing or invalid.
    Last edited by phpman; Jan 24th, 2003 at 04:03 PM.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    so do you know how i can get the latency of an ip?

    and say i want to execute the bat file witha variable? would it look like this? exec("file.bat",$variable);

  6. #6
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    why do you want the latency?

    either it is there or not

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448
    I would like the latency so I can run my script from other places and find the latency of an ip without using command promt. On some computers i go to i cant use command promt.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width