hi guys,
here is my problem:
i have to maintain a web vb.net application developped some times ago.
The application was developped on Windows2000 SP3 with Visual Studio
2003 (7.1).
and the application was running on windows 2000 SP3 with the usual IIS.
Right now i need to make it work, on a Windows 2003 SP1 server (but i
need the keep the dev environment on VisualStudio 2003).
this app need to run some batch file, unfortunately for me, on the
initial development instead of rely on the .NET1.1 references classe an
activex was use to run the batch files.
And as I fear this ActiveX doesn't exist on the win2003 OS, so i wrote
a quick launcher for batch file (as you can read below).
I test it under Win2000 OS, and it run fine giving the output of the
batch.
So i deployed the application on Win2003, the same way under
Windows2003.
(well registering .NET 1.1, and allowing it via inetmgr , I also put
trace on,
from web.config file
<identity impersonate="tr ue" />
<authenticati on mode="Windows" /></authentication>
<authorizatio n>
<allow users="*" / <!-- Allow all users -->
</authorization>
<trace enabled="true" requestLimit="1 0" pageOutput="fal se"
traceMode="Sort ByTime" localOnly="fals e" />
)
Then i log on the web app using a user registered on the domain, And i
would really love if the batch could launch.
but unfortunately the launcher return nothing from the StandardOutput
from the process.start.
but no error, no exception. I also check in the eventviewer if there
would be some error raised (i was thinking about silent impersonation)
but unfortuntely i can't found anything...
As i wasn't sure about the impersonation I checked the url :
http://support.microsoft.com/kb/306158/en-us , i implemented any
solution but i keep the same behaviour no error, and an empty result.
So if anybody could raise a solution from his hat it will really be
enjoyable.
Thank you so much in advance.
Kind regards,
Steve
ps : well i just can't make any change on the OS configuration (it's
another team which is responsible for this and they won't go this way)
pps : i run the batch by hand with the same user, and it run fine.
from web.config file
<identity impersonate="tr ue" />
<authenticati on mode="Windows" /></authentication>
<authorizatio n>
<allow users="*" / <!-- Allow all users -->
</authorization>
<trace enabled="true" requestLimit="1 0" pageOutput="fal se"
traceMode="Sort ByTime" localOnly="fals e" />
here is my launcher :
Function executeLocalBat ch(ByVal CommandeComplet e As String, ByVal
LesArguments As String, ByVal TimeOutInSecond s As Int32, ByVal laTrace
As TraceContext) As String
Dim resultat As String = ""
Dim myProcess As Process = New Process
Dim sin As StreamWriter
Dim sout As StreamReader
Dim serr As StreamReader
myProcess.Start Info.FileName = CommandeComplet e
myProcess.Start Info.Arguments = LesArguments
myProcess.Start Info.UseShellEx ecute = False
myProcess.Start Info.CreateNoWi ndow = True
myProcess.Start Info.RedirectSt andardInput = True
myProcess.Start Info.RedirectSt andardOutput = True
myProcess.Start Info.RedirectSt andardError = True
Try
myProcess.Start ()
sin = myProcess.Stand ardInput
sout = myProcess.Stand ardOutput
serr = myProcess.Stand ardError
myProcess.WaitF orExit(TimeOutI nSeconds * 1000)
resultat = sout.ReadToEnd( )
resultat += "Erreur :[" + serr.ReadToEnd( ) + "]"
Catch ex As Exception
Dim error_msg As String = handleText_Exce ption(ex, "erreur
dans l'execution ")
laTrace.Warn(er ror_msg)
resultat += error_msg
End Try
laTrace.Warn("e xec seems ok")
If Not myProcess.HasEx ited Then
myProcess.Kill( )
Throw New SystemException ("Erreur : l'application " +
CommandeComplet e + " ne s'est pas arreté normalement, son execution
s'est probablement mal passée")
End If
laTrace.Warn("e xec the result is = [" + resultat + "]")
Return resultat
End Function