PHP and exec(dir)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jodleren

    #1

    PHP and exec(dir)

    Hi all!

    I have been using opendir and scandir, but I want to try something
    else.
    Idea: using dir, and a) getting the result b) saving it as a file.

    As I have problems with executing files directly, it create a bat file
    and executes that.
    I can execute command, but by some reason I dont get any response (it
    should return something, and I get "")
    The missing response is why I create a file.

    I create the file on the network ( \\server\somewh ere ) like this

    dir "\\server\somew here\filesdir\" >"\\server\some where\result.tx t"

    Here is the odd thing: dir cannot read from the network - the bat file
    is created there, it creates the result.txt file, but emtpy as it
    cannot read from the network. Reading from c:\ and it works.

    Did I miss something here?

    BR
    Sonnich

  • #2pencil

    #2
    Re: PHP and exec(dir)

    Did I miss something here?

    I assume (based on the directory structure) that you are running this
    on Windows?

    Our php runs on FreeBSD Unix & has direct access to & can work
    interactivly with the Operating System.

    Perhaps you could create the batch file to access the network drives,
    & have PHP output to a local (writable) text file. What are the
    folder level access permitions that this script is trying to read from
    & write to?

    -#2pencil-
    Computer Design and Repair. Providing Nintendo 3DS, Apple iPad/iPhone, Laptop, PC, and Web Development/SEO/Hosting services.


    Comment

    Working...