Click here to Skip to main content
15,886,075 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ALL ,


I have vbs code to start/stop indexing services in windows and add catalog,scope using vbs. The vbs code is

--To Start Indexing Service in windows
VB
Set objISAdm = CreateObject("Microsoft.ISAdm")
If objISAdm.IsRunning= False then
    objISAdm.start()
end if


--To create catalog Indexing Service in windows
VB
Function AddCatalog(bstrCatName As String, bstrCatLocation As String) As Object
Set objISAdm = CreateObject("Microsoft.ISAdm")
objISAdm.stop()
Set objCatalog = objISAdm.AddCatalog("MyCatalog","c:\Mycatalog")
objISAdm.start()



--To assign scope to a catalog Indexing Service in windows
VB
Set objISAdm = CreateObject("Microsoft.ISAdm")
Set objCatalog = objISAdm. GetCatalogByName("MyCatatlog")
Set objScope= objCatalog.AddScope("C:\myfiles",False)
objScope.Alias = "MyCatalogScope"



I want the same code in C#. How to convert or equivalent classes.
Posted
Updated 30-Sep-11 20:44pm
v2

To start/stop service it is better to use WMI see here : Using WMI to manipulate services (Install, Uninstall, Start, Pause etc)
 
Share this answer
 
v2
Hope here you can find solution
Convertor
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900