Archive: How to Detect / Start / Stop SQL Service Manager


How to Detect / Start / Stop SQL Service Manager
Hello Everybody,

I've made an installer which installs MSDE 2000. Now it needs some fine tuning, so seeking help from you people.

;this runs the setup of msde:
nsExec::Exec "$INSTDIR\setup.exe"

;then I tries to start the SQL Service Manager
;to avoid a reboot for automatic start of Service Manager.

To start the SQL service manager, the following command does not runs on Windows 2000, though it is fine in Win XP:

nsExec::Exec "cmd /C NET START MSSQLSERVER"
(this command is running fine in XP)

So how to start the service manager in Windows 2000?

Moreover I want to know how to detect whether the SQL Service Manager is running or not, irrespective of user's using any version of Windows.

With regards,


I'll get back to this thread...I've messed up something...NET START command works in Windows 2000.


Hi,

You can use the readregstr command to detect the MSSQL on local computer.

To start it for example:

execwait 'scm.exe -Action 1 -Service MSSQL$Example -silent 2


SORRY FRIENDS!

There is some basic error in my initial post. First I want to declare that nsExec::Exec "NET START MSSQLSERVER" also works in Windows 2000.

From my debugging, what I've come to know that from my these two commands:
nsExec::Exec "$INSTDIR\setup.exe"
nsExec::Exec "NET START MSSQLSERVER"
MSDE gets installed and the service MSSQLSERVER also gets started without reboot.

But if I reboot the computer the Service Manager is added up in the Windows StartUp and the icon of SQL Server Service Manager comes in the Task bar. And this shows the user that the MSDE has been properly installed. How can I accomplish this job? i.e. to add it up in the Windows StartUp and in the Task bar.


Vissers Thanks a lot!

Its seems my issue can be resolved by your example. Let me try...will get back to you.


I've to leave my office now as its off 4 the day 2day.

But in the meantime Vissers, can you confirm me that your this command with scm.exe will be able to start the Service Manager for the first time just after the msde has been installed and no reboot is done, and from startup Service Manager not activated too. If it can still start the service manager my purpose will be fullfilled.

Hope to see your reply, when I come to office tomorrow.

Have a nice day!

With regards,


From my debugging, what I've come to know that my these two commands:
nsExec::Exec "$INSTDIR\setup.exe"
nsExec::Exec "NET START MSSQLSERVER"

are running simultanelously!

The installer is not waiting for the setup.exe (the msde setup) to get its operation finished. Its starts the second command nsExec::Exec "NET START MSSQLSERVER". And thats why my command is not giving the desired output.

So how to wait till my 1st command is finished? The 'Sleep' command will not be proper to use here, as I don't know how much time it will take to complete the msde setup on different computers.

Anyone listening? Or a separate post required?


use:


execwait '$INSTDIR\setup.exe'
execwait 'NET START MSSQLSERVER'


nsExec already waits, that won't help. I already answered you in the other thread.