PHP file
<?php
echo exec("rules.bat");
?>
BAT file
net user username Welcome12! /ADD /FULLNAME:Test /PASSWORDCHG:NO
When I try to run the php script I get the following
C:\inetpub\wwwroot\e\sso\home>net user username Welcome12! /ADD /FULLNAME:Test /PASSWORDCHG:NO
But no user is added. I can run the BAT file from the same directory and the user is added. I've also tried to run the following in my php script and it doesn't work
<?php
echo exec("net user username Welcome12! /ADD /FULLNAME:Test /PASSWORDCHG:NO");
?>
I've also tried using system, shell_exec, passthru
When I run
echo exec("whoami");
it shows my user that has admin rights