pass values from asp.net to batch file

elegipcio

New member
Joined
Nov 24, 2006
Messages
1
Programming Experience
Beginner
Hello everyone
i'm new to asp.net i'm looking to How to get values (Variables) pre Declared in web form & pass it to a batch file.
coz i've to get this values to be added to the batch file to Automate the process of creating records & Zones in our DNS server

So, as a simple example i'll suppose to create a new folder on drive C:\ the name of this folder will come from the asp.net web form.
i searched & get closer to the following Code

so again , my batch file will be (C:\Do.bat) --------- > & i wrote in it for example :
VB.NET:
@ECHO OFF
mkdir c:\%A%
is this correct ?
in ASP.net i've a text Box & a buttoni imported:
VB.NET:
Imports System
Imports System.Diagnostics
Imports System.ComponentModel
& when I press the Button :
VB.NET:
Dim A As String
A = TextBox1.Text
Dim p As New Process
With p
With p.StartInfo
.FileName = "C:\Do.bat"
.Arguments = A
End With
.Start()
.WaitForExit()
End With
I get the following Error:
'StartInfo' is not a member of 'Process'.

May you tell me what i missed ?
Thanks in advance
 
Last edited by a moderator:
check to see if it is a member of the object your error is at the 'with p.startinfo ' y should never do this, instead
VB.NET:
with p
.startinfo
end type

also the startinfo must pass its value to a variable
VB.NET:
with p
variable = .startinfo()
end with
 
Last edited by a moderator:
Back
Top