Sorry for the repost.
I'm trying to run a string that has linefeeds.
The below code works if what comes back from the webservice is a
single line, but if it's more than one line it chokes and does not
perform any of the lines.
Option Explicit
Dim runwhat
Dim oShell
Dim soapClient
set soapclient = CreateObject("MSSOAP.SoapClient")
SoapClient.ClientProperty("ServerHTTPRequest") = True
On Error Resume Next
Call soapclient.mssoapinit("http://mycomputer/LoginScriptsWebService/
Service.asmx?wsdl")
if err <> 0 then
wscript.echo err.description
end if
runwhat=soapclient.LoginScript
wscript.echo (runwhat)
Set oShell = CreateObject("WScript.Shell")
oShell.Run "%comspec% /c (" & runwhat & ")"
My very simple webservice (vb.net) looks like this:
Public Function LoginScript() As String
Dim out As String
out = "net use y: \\mycomputer\c$\jcp"
out = out + vbNewLine + "net use x: \\mycomputer\c$\jcp"
Return out
End Function
If I clip and paste the output from the vbscript and paste it back
into DOS it takes the two commands with no problem. A hex review of
the output show the line feeds %0A%0D as expected.
Thanks for any help or information.