Mirá, me parece que eso le deberías dar permisos de ejecución de líneas de comandos en el IIS.
Más allá de eso... creo (estoy casi seguro) que ese tipo de cosas lo tenés que ejcutar en tu servidor, o sea.. en un hosting no creo que te permitan hacer ese tipo de cosas.
Yo lo haría con una DLL hecha en Visual Basic y consumis la clase y los métodos desde ahí.
La historia es en la parte general ponés este código.
Código:
Private Declare Function CreateProcessA Lib "kernel32" (ByVal lpApplicationName As Long, ByVal lpCommandLine As String, ByVal lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadID As Long
End Type
Después hacés esta función
Código:
Public Function EjecutarBatch(Fichero As String) As Integer
Dim Valor As Long
Dim Comienzo As STARTUPINFO
Dim Proceso As PROCESS_INFORMATION
EjecutarBatch = 0
Comienzo.cb = Len(Comienzo)
Valor = CreateProcessA(0&, Fichero$, 0&, 0&, 1&, &H20&, 0&, 0&, Comienzo, Proceso)
Valor = WaitForSingleObject(Proceso.hProcess, -1&)
If Valor = -1 Then
EjecutarBatch = 1
Else
Valor = CloseHandle(Proceso.hProcess)
End If
End Function
Para probarlo desde el Visual lo llamás:
Código:
call EjecutarBatch("C:\pp.bat")
Lo que tenés que hacer es registrar el componente... tanto por COM o COM+ y después llamás a la función que hiciste
Código:
call Objeto.EjecutarBatch("C:\aa.bat")
Espero haber sido de ayuda.
SALUDOS!