Hi Christian
The problem was: It does not run on the server in this way:
Const nantPfadName = """C:\Program Files (x86)\nant-0.91-alpha2\bin\Nant.exe"" "
Const nantBuildPath = "C:\Documents and Settings\wolfgangu\My Documents\openpetra\trunk3\"
Const reportPath = "C:\Documents and Settings\wolfgangu\My Documents\openpetra\trunk3\"
Const reportName = "Report.txt"
I've removed some "".
And the other point is a line break wich was created by the forum software
Private Sub CallNant(nantPfadName, strPathOfBuildFile, strNantCommand, strReportDirectory, strReportName)
This is one line. I do not know why this are two lines.
Const nantPfadName = """C:\Program Files (x86)\nant-0.91-alpha2\bin\Nant.exe"" "
Const nantBuildPath = "C:\Documents and Settings\wolfgangu\My Documents\openpetra\"
Const reportPath = "C:\Documents and Settings\wolfgangu\My Documents\openpetra\"
Const reportName = "Report.txt"
nantCommand = Wscript.Arguments.Item(0)
CallNant nantPfadName, nantBuildPath, nantCommand, reportPath, reportName
Private Sub CallNant(nantPfadName, strPathOfBuildFile, strNantCommand, strReportDirectory, strReportName)
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set objWSH = WScript.CreateObject("WScript.Shell")
Const ForReading = 1
Const ForWriting = 2
Set oFSFile = objFSO.OpenTextFile(strReportDirectory & strReportName,ForWriting,True)
objWSH.CurrentDirectory = strPathOfBuildFile
Set objExec = objWSH.Exec(nantPfadName & " " & strNantCommand)
Do While Not objExec.StdOut.AtEndOfStream
strInput = objExec.StdOut.Read(1)
oFSFile.Write(strInput)
Loop
oFSFile.Close
Set oFSFile = objFSO.OpenTextFile(strReportDirectory & strReportName,ForReading)
strFileContent = oFSFile.ReadAll()
Const strBuildFailed = "BUILD FAILED"
If (instr(strFileContent, strBuildFailed)) Then
msgbox "Path of build file: " & strPathOfBuildFile, , "NantCommand: " & strNantCommand & " failed!"
End If
End Sub