Raven65
Well-known member
- Joined
- Oct 4, 2006
- Messages
- 305
- Programming Experience
- 3-5
Alright, so this one has me stuck.
My setup is this:
Server/Client service using TCPClient/Listener. Client sends the Listener a path to run. Listener using Process to launch that path locally.
This works fine on one machine. However on another I am having a terrible time. Code to run the process is this:
So, everything else works. The data is received and reply sent back to the client, but it simply will not run the process. I continue to get a "The system cannot find the drive specified" error.
What Im trying to launch is just a batch file from another server. I've verified the system has access to that folder and I can manually run the bat if I try. Also, the user/pass stuff I added recently to try and get past this problem, the user I am giving also has access to run the bat.
Im really stuck here, Google has been unproductive around this particular situation...I dont understand how the system cannot find the "drive". I've tried UNC and mapped paths, both produce the same results.
My setup is this:
Server/Client service using TCPClient/Listener. Client sends the Listener a path to run. Listener using Process to launch that path locally.
This works fine on one machine. However on another I am having a terrible time. Code to run the process is this:
VB.NET:
Dim p As New Process()
p.StartInfo.FileName = "cmd"
p.StartInfo.Arguments = "/c " & data.Substring(4)
p.StartInfo.UseShellExecute = False
p.StartInfo.UserName = "USERNAME"
Dim password As New System.Security.SecureString
Dim givenPassword As String = "PASSWORD"
For x As Integer = 0 To givenPassword.Length - 1
password.AppendChar(givenPassword(x))
Next
p.StartInfo.Password = password
p.StartInfo.RedirectStandardError = True
p.StartInfo.RedirectStandardInput = True
p.StartInfo.RedirectStandardOutput = True
p.Start()
p.WaitForExit()
myWriter.Write("Ec " & p.ExitCode)
myWriter.WriteLine()
myWriter.Write("Er: " & p.StandardError.ReadToEnd)
myWriter.WriteLine()
myWriter.Write("Op: " & p.StandardOutput.ReadToEnd)
myWriter.WriteLine()
If p.ExitCode = 0 Then
msg = System.Text.Encoding.ASCII.GetBytes("Process Completed.")
stream.Write(msg, 0, msg.Length)
Else
msg = System.Text.Encoding.ASCII.GetBytes("Process Failed. Returned: " & p.StandardError.ReadToEnd)
stream.Write(msg, 0, msg.Length)
End If
p.Dispose()
p = Nothing
So, everything else works. The data is received and reply sent back to the client, but it simply will not run the process. I continue to get a "The system cannot find the drive specified" error.
What Im trying to launch is just a batch file from another server. I've verified the system has access to that folder and I can manually run the bat if I try. Also, the user/pass stuff I added recently to try and get past this problem, the user I am giving also has access to run the bat.
Im really stuck here, Google has been unproductive around this particular situation...I dont understand how the system cannot find the "drive". I've tried UNC and mapped paths, both produce the same results.