View Single Post
Old 02-13-2013, 09:02 PM   PM User | #8
Raphael
New Coder

 
Join Date: Mar 2009
Posts: 70
Thanks: 3
Thanked 3 Times in 3 Posts
Raphael is an unknown quantity at this point
I think I got it!

I had to specify the domain\username like this:

$cmd = 'schtasks.exe /query /s <server name> /u <domain>\<username> /p <password> /tn "repost_labor" > test.txt >2>&1';
echo exec($cmd, $out, $retval);
print_ri($out);

When I put that in it worked!

Thanks so much for your help, Fou-Lu, especially with the idea and code to output the STDERR.
Raphael is offline   Reply With Quote