Hi,
I'm having a big problem using the exec() function. I want to execute a remote cacls to view and parse the returned accesslist. I use PsExec from SysInternals, and it's a Windows environment (and active directory) with apache. The problem is this:
Making some tests, I have checked thar the following line works:
$comando = 'psexec \\\\'.$_CONFIG['equipoRemotoPsExec'].' -u '.$_CONFIG['userPsExec'].' -p '.$_CONFIG['passwdPsExec'].' -accepteula cacls "C:\\Install\\SUPPORT"';
exec ($comando, $arr );
and it returns the accesslist.
(psexec \\remote address -u user -p password -accepteula command)
But the remote folder must be a parameter (variable) and after spending too many hours, I`ve checked that if the destination folder parameter has some spaces, it won't work (and it could happen):
$comando = 'psexec \\\\'.$_CONFIG['equipoRemotoPsExec'].' -u '.$_CONFIG['userPsExec'].' -p '.$_CONFIG['passwdPsExec'].' -accepteula cacls "C:\\Documents and Settings\\All Users\\Desktop"';
exec ($comando, $arr);
Any suggestions or ideas? Has someone have this problem too?
Thak you very much and sorry about my english,
Juan
Problems with exec and psexec
Moderator: General Moderators
-
Peter Kelly
- Forum Contributor
- Posts: 143
- Joined: Fri Jan 14, 2011 5:33 pm
- Location: England
- Contact:
Re: Problems with exec and psexec
When its a space change it to %20 possibly?
Re: Problems with exec and psexec
Uhmm... good idea, thank you, but it doesn´t work. I'm afraid I'll must rename all the files and directories in the remote computer that could be searched by removing all the blank spaces in their names...
Thank you very much for the reply !!
Thank you very much for the reply !!