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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -