E
Eric Wood
We have an application that is accessed using shared drives, client
executes program from server. We have already coded the program to
create and save the a bat file either locally on the users machine or
on the
server. Our problem is that when we execute the bat file from the
vb code it does not work properly. The bat file is used to connect to
a commnad line service running on the server and update a file in
another system. We can execute the bat properly from our local drives
as well from the server if we use pc anywhere and the system is
updated. If we execute it from within the vb code it fails, we see the
command window come up but the update does not happen. In order to run
properly the bat must be in the same directory as a client executable
and a mapping file I am wondering if when running it from within the
client code we are disassocating it from these. The code we are using
to create and execute the bat is as followd.
Dim strMacNo As String = txtField8.Text
Dim strHelpDeskNo As String = txtField5.Text
Dim strMessage As String = txtField11.Text
Dim srw As StreamWriter = File.CreateText(FILE_NAME)
srw.WriteLine("REM :START")
srw.WriteLine("client AddCallNote.txt ResultsFile.xml uid pwd " &
strHelpDeskNo & " ADMIN MOVE_TEAM PROGRESS_UPDATE " & """" &
strMessage & """" & " " & """" & strMacNo & """")
srw.WriteLine("REM GOTO START")
srw.Close()
Dim p As Process = New Process
Dim s As String
Dim outfile As String = Application.StartupPath & FILE_NAME
Dim sysFolder As String =
System.Environment.GetFolderPath(Environment.SpecialFolder.System.System)
p.StartInfo.FileName = "cmd.exe"
p.StartInfo.Arguments = "/C cd " & _
sysFolder & " && dir *.com >> " & Chr(34) & _
outfile & Chr(34) & " && exit"
p.StartInfo.WindowStyle = ProcessWindowStyle.Maximized
p.StartInfo.CreateNoWindow = False
p.Start()
any ideas?
executes program from server. We have already coded the program to
create and save the a bat file either locally on the users machine or
on the
server. Our problem is that when we execute the bat file from the
vb code it does not work properly. The bat file is used to connect to
a commnad line service running on the server and update a file in
another system. We can execute the bat properly from our local drives
as well from the server if we use pc anywhere and the system is
updated. If we execute it from within the vb code it fails, we see the
command window come up but the update does not happen. In order to run
properly the bat must be in the same directory as a client executable
and a mapping file I am wondering if when running it from within the
client code we are disassocating it from these. The code we are using
to create and execute the bat is as followd.
Dim strMacNo As String = txtField8.Text
Dim strHelpDeskNo As String = txtField5.Text
Dim strMessage As String = txtField11.Text
Dim srw As StreamWriter = File.CreateText(FILE_NAME)
srw.WriteLine("REM :START")
srw.WriteLine("client AddCallNote.txt ResultsFile.xml uid pwd " &
strHelpDeskNo & " ADMIN MOVE_TEAM PROGRESS_UPDATE " & """" &
strMessage & """" & " " & """" & strMacNo & """")
srw.WriteLine("REM GOTO START")
srw.Close()
Dim p As Process = New Process
Dim s As String
Dim outfile As String = Application.StartupPath & FILE_NAME
Dim sysFolder As String =
System.Environment.GetFolderPath(Environment.SpecialFolder.System.System)
p.StartInfo.FileName = "cmd.exe"
p.StartInfo.Arguments = "/C cd " & _
sysFolder & " && dir *.com >> " & Chr(34) & _
outfile & Chr(34) & " && exit"
p.StartInfo.WindowStyle = ProcessWindowStyle.Maximized
p.StartInfo.CreateNoWindow = False
p.Start()
any ideas?