|
Thanks for all of the quick replies! I had no idea this board was so active.
COMSPEC on the system I'm working with to debug this problem is: C:\WINNT\system32\cmd.exe
Nothing weird with COMSPEC, I think, and I've also tried hard-coding the whole thing, which hasn't made a difference.
I want to avoid trying things like WSHPIPE(), since I can't be certain the target systems have WSH, WMI, etc. installed. I really want to restrict myself to just using the net start command, unless there's some COM-ish way I can do this that doesn't involve any other dependencies.
Also, xnet.exe isn't available to the target systems, but I would run into the same problem if I used it anyway. Redirection here appears to be the problem and not the command executed.
Shawn - good suggestion on piping to find. I just tried it and it's also returning an @ERROR of 255. This happens regardless of what value I search for (even if it is in the list of running services). "Error Log" = 255 and "Error Logasdfjdf" also returns 255.
Also, in case it matters, I've also tried:
%COMSPEC% /C net start > services.tmp 2>&1
(added redirection of STDERR). This didn't do anything different for me, either. It almost seems like it just doesn't like > or | characters, but they really are required for what I'm looking to do.
Any other thoughts? I'm not looking to shoot good suggestions down, but I've tried eveything I can think of and this *SHOULD* work.
|