[jcifs] Remotely start windows service using java

西门烧雪 Simon sekatsimon at gmail.com
Mon Sep 21 14:28:05 MDT 2009


Dear all,

I am very excited with learning the jcifs component in the past few
days.  Made some progress and I feel it's very promising to be able to
accomplish my task: research how to remotely start Windows Service
using Java.

I learned that I should be using the predefined svcctl pipe.

The code should be something like:

SmbNamedPipe pipe = new SmbNamedPipe( "smb://server/IPC$/PIPE/svcctl",
        SmbNamedPipe.PIPE_TYPE_RDWR | SmbNamedPipe.PIPE_TYPE_CALL );
OutputStream out = pipe.getNamedPipeOutputStream();
InputStream in = pipe.getNamedPipeInputStream();

I think I should the operation StartServiceW of such pipe
(http://www.hsc.fr/ressources/articles/win_net_srv/msrpc_svcctl.html).

I need guidance with what I should do next?  What to write to the
outputstream which would trigger the start of, say, the server
process?

-- 
Simon
西门烧雪


More information about the jCIFS mailing list