PHP and exec(dir)

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all!

I have been using opendir and scandir, but I want to try something
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\somewhere ) like this

dir "\server\somewhere\filesdir\" >"\server\somewhere\result.txt"

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?


Re: PHP and exec(dir)

Quoted text here. Click to load it

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?


Site Timeline