Cannot netuse be used to obtain permissions in exec () of php? Exec (netuse \ 192.168.2.102 \ ipc $ & quot; 1 & quot; user: & quot; administrator & quot ;); in this case, the exec (netuse \ 192.168.2.102 \ ipc $) cannot be connected. in this way, an ipc $ can be created, but cannot be obtained using net use in exec () of php?
Exec ('Net use \\\\ 192.168.2.102 \\ ipc $ "1"/user: "administrator "');
This cannot be connected.
Exec ('Net use \\\\ 192.168.2.102 \\ ipc $ ');
In this way, you can create an ipc $ with no administrator permission.
I just want to use the cmd command to obtain the administrator permission of the remote machine and start a service. the above content is executed in the cmd window.
Is put in the code, how should I write this net use?
------ Solution --------------------
Yes, you cannot obtain the permission.
But you can change it.
The balance product program in web mode writes the commands to be executed to the transition file.
Use a php program running in command line mode to act as a waiting process, and constantly check whether there are commands to be executed in the transition file
Execute if any