0

fsutil volume diskfree e:

Error: Access is denied.

That happens when I run it from a normal cmd.exe, and whenever I run it from my PHP CLI scripts.

Only by manually opening an "elevated" cmd.exe does it output the actual output of the command.

Why does it need "elevated" status to run such a non-security-related command? It makes it impossible for me to find out how much free space there is for my backup disks from my PHP CLI system.

And even if I somehow figure out some way to run my PHP CLI system "elevated", which is likely to be very problematic in many ways, if even possible at all, I still wonder why this would be required.

1 Answer 1

0

How can such a dangerous command not be protected and limited to advanced users?

This is Microsoft's answer to your question from the documentation:

You must be logged on as an administrator or a member of the Administrators group to use fsutil. This command is quite powerful and should be used only by advanced users who have a thorough knowledge of Windows operating systems.

As regarding elevation in PHP : It's extremely dangerous for a web server to have administrator permissions. It is the most vulnerable since it's exposed to external attacks. I very strongly advise against it.

6
  • How is it a "dangerous command" to fetch the number of free bytes on a disk? And I said nothing whatsoever about any webserver. What are you talking about?
    – Ransier
    Commented Oct 15, 2020 at 12:34
  • Have you looked at the other sub-commands of fsutil?
    – harrymc
    Commented Oct 15, 2020 at 12:36
  • Not really, but the only reason I (try to) use it in the first place is that it was the only command I could find to do this. I don't need all of the other (assumed) power that it has.
    – Ransier
    Commented Oct 15, 2020 at 12:42
  • How is Microsoft supposed to know that you only use this one sub-command? I suggest that instead of this post, that you open another post asking how you can from PHP find the free space on a disk without requiring elevation. Although this being a programming question, its place is more on StackOverflow.
    – harrymc
    Commented Oct 15, 2020 at 12:49
  • They could extremely easily tell what command I'm trying to execute and not require "elevation" for this. I don't understand why you'd think they would not be able to. But since this is done on the command line, I disagree that it's a programming question.
    – Ransier
    Commented Oct 15, 2020 at 13:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .