|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hello,
I was wondering if someone could help me out with a quick VBscript. What I want it to do is to check is MSsql is running and if it is. Share out two folders. I have no idea how to check if a service is running. Below I have pasted what I have so far, and that's only getting the 2 directories shared. Any help will be appreciated. Const FILE_SHARE = 0 Const MAXIMUM_CONNECTIONS = 25 strComputer = "mycomputer" Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set objNewShare = objWMIService.Get("Win32_Share") errReturn = objNewShare.Create _ ("E:\Test", "TestShare", FILE_SHARE, _ MAXIMUM_CONNECTIONS, "This folder is shared for testing purposes") Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set objNewShare = objWMIService.Get("Win32_Share") errReturn = objNewShare.Create _ ("C:\Test2", "Test2Share", FILE_SHARE, _ MAXIMUM_CONNECTIONS, "This folder is shared for testing purposes") |
|
#2
|
||||
|
||||
|
The easiest way would be to try to establish a connection to the MSSql server.
Also, your subject title in unacceptable. You can refer to the sticky thread at the top of this forum for more information on how to post a question. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > VBS question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|