windows - How to run system() as administrator in PHP? -


i need send commands system admin throught php system() function on windows environment.

i know can dangerous, need that.

i have solved issue using toolkit named cpau

by using can exec command simply:

cpau -u administrator -p pwd_here -lwp -ex "net user myuser mypwd /add" 

to make work i've needed change administrator password in computer management > users.

for people saying "use runas"

i not use runas because prompts password , can't pass in same command line.

ps: remember place cpau in php folder.


Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -