raphael75 Posted April 1, 2014 Share Posted April 1, 2014 I have this code to map two network drives: <?php $cmd = 'net use t: \\comp1\folder /u:dom\user pwd'; $cmd .= 'net use u: \\comp2\folder /u:dom\user pwd'; exec($cmd, $out, $ret); ?> When exec() runs I get this: System error 67 has occurred.The network name cannot be found. and $ret echos 2 I've done some research but I can't figure out what is causing System error 67. Any help is greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/287450-php-net-use-error/ Share on other sites More sharing options...
raphael75 Posted April 1, 2014 Author Share Posted April 1, 2014 Figured it out - gotta escape the double \'s <?php $cmd = 'net use t: \\\\comp1\folder /u:dom\user pwd'; $cmd .= 'net use u: \\\\comp2\folder /u:dom\user pwd'; exec($cmd, $out, $ret); ?> Link to comment https://forums.phpfreaks.com/topic/287450-php-net-use-error/#findComment-1474647 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.