I am working on a php code as shown below in which I am making a connection to network drive using credentials.
Php code:
$user = 'mickeymouse';
$password = 'helloworld';
exec('net use "\\\INVEST-ST-001\Video_Remap\podcast\" /user:"'.$user.'" "'.$password.'" /persistent:no'); // Access a network drive using credentials
$src_dir = ('\\\INVEST-ST-001\Video_Remap\podcast\incoming_folder');
$destination_dir = ('\\\INVEST-ST-001\Video_Remap\podcast\outgoing_folder');
exec('net use "\\\INVEST-ST-001\Video_Remap\podcast" /delete /yes'); // Then deleting it
$mp4_files = preg_grep('~\.(mp4)$~', scandir($src_dir)); // Line D
I also made a connection through net use command:
net use "\\INVEST-ST-001\Video_Remap\podcast" /user:"mickeymouse" "helloworld" /persistent:no
and I got the following message:
The command completed successfully
The version of php which I am using is:
PHP version: 5.3.28
Error:
The error which I am getting on the webpage is:
The system cannot find the path specified. (code: 3) in W:\ahdhd\shshshs\status.php on Line D in the php code above.
Problem Statement:
I am wondering what changes I should make in the php code above or any other net use command I need to use in order to make a connection to network drive using credentials in php.
Edited:
I am able to access everything inside test directory but not inside Audio_Remap directory.