Command Line in VB.NET


Hi all,
i wanna run this line in command prompt .."C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -s  W3SVC/" & siteID & "/Root/"
but i dunno how to call it using vb.net.
i try to run it manually by click start>run>cmd.......and enter the line above.......it works......
but now i wanna call this line so that it run in command prompt..........how can i do that in vb.net ?
pls reply me as soon as possible if anyone of you know the solutions......thanks
0
goh6613
5/29/2006 9:47:38 AM
📁 asp.net.visual-basic.net
📃 3721 articles.
⭐ 0 followers.

💬 1 Replies
👁️‍🗨️ 764 Views



hi all, i try to call the cmd.exe to run the specific action by using the code below...
Dim objProcess As Diagnostics.Process
        Dim objProcessInfo As Diagnostics.ProcessStartInfo
        Try
            objProcess = New Diagnostics.Process()
            objProcessInfo = New Diagnostics.ProcessStartInfo("cmd.exe")
            objProcessInfo.RedirectStandardInput = True
            objProcessInfo.RedirectStandardOutput = True
            objProcessInfo.UseShellExecute = False
            objProcess = Diagnostics.Process.Start(objProcessInfo)
            objProcess.StandardInput.WriteLine("C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -s  W3SVC/" & siteID & "/Root/")
            objProcess.StandardInput.WriteLine("exit")
        Catch ex As Exception
        End Try
can anyone please tell what's wrong with this code ? i run this code , but it seem like it did not call any action which i want it to do....
thanks
0
goh6613
5/29/2006 10:45:11 AM
Reply: