Better way then System()

Posts 1–6 of 6 · Page 1 of 1
Better way then System()
Is there a function better then system to execute console commands?

I would like to start and stop a service, but it's pretty annoying using the system() command because it tells you everything that's happening and makes my window look messy.
not that i know but system(""); is the shortest and easiest way to do it.
Quote Originally Posted by Matrix_NEO006 View Post
not that i know but system(""); is the shortest and easiest way to do it.
I'm aware of how to use system, but I don't want everything that's happening popping up on the screen.
Basically the core of it would be calling these functions..

OpenSCManager()
OpenService
StartService() / StopService() or ControlService() with start/stop params
CloseServiceHandle()

Here's a fun sample from MS;
http://msdn.microsoft.com/en-us/libr...74(VS.85).aspx


Or you can use WMI (Win32_Service class) but that involves COM which I doubt would make any sense right now
there you go thats a good example.
you can clear the screen too with system("cls"); if it's getting too messy... just tossin that out.
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Talk with us