T
T
trevoga_su2016-07-19 09:14:43
cmd/bat
trevoga_su, 2016-07-19 09:14:43

Why is there no permission to create files?

Hi all.
I'm creating an .exe file to deploy a set of (working, tested) scripts to a windows server using the Smart Install maker.
After installation, I run a bat file like this:

@echo off
.\php\php.exe .\script.php >> .\log 2>&1

here the error immediately falls out: "Access denied"
AND, it doesn't even reach the execution of the script.php script - windows doesn't even try to start PHP.
If you remove the redirect to the log, then any PHP attempts to create the file also fail: "failed to open stream: Permission denied in ...."
Which way to dig? I don't understand at all.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2016-07-19
@res2001

Toward the current directory and access rights to it.
Make the following batch file: cd & pause
And run it just like you ran the previous one. The default directory for the running batch file will be displayed on the screen. I assume that it will be %systemroot%\system32 - and writing to it without increasing access to the administrator is prohibited.
I recommend that you specify the full path to the folder for the log file, to which the user definitely has access. For this purpose it is convenient to use %TEMP%

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question