473,326 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Thread.Start w/ Switches Problem

Hello...

Has anyone else have had the problem of using the Thread.Start method
in VB.Net using switches in the command line? I am using VB.Net 2005
and I create a command line of the main program to launch (in this case
it is a VBScript frm Microsoft called IPSec.vbs) and that command line
contains the various switches the script requires to run. If I just
try to launch the command line without the switches, I have no
problems. As soon as I append the switches to the command line, then
it will not launch giving a file not found error. However, I am using
debug.print to show the string variable value it is passing to the
Thread.Start method (which includes the full command line w/ switches).
If I copy and paste this exact line into a command prompt or into the
Start>Run box, it launches the with no problems. Is there something I
need to do in order to get this to launch a process with command line
switches? Thanks in advance and below is the code I am using:

Dim relayServers() As String = {"server1", "server2", "server3"}

Dim counter As Integer = 0
For counter = counter To relayServers.GetUpperBound(0)
Dim myThread As New Process
Dim applicationPath As String = Application.StartupPath
Dim programPath As String = Chr(34) + applicationPath + "\ipsec.vbs"
+ Chr(34)
Dim programSwitches As String = _
" -d dc1 -s " + relayServers(counter) + " -i 1 -o a -r connection
-v " + textBox.Text
Dim threadCommand As String = programPath + programSwitches
myThread.Start(threadCommand).WaitForExit()
Next
- Ron

Jun 12 '06 #1
0 1026

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kevin Otte | last post by:
Hi, I'm currently working on a little tool to copy files over the network using FileStreams. I've written a class that takes care of that. I create an instance of the class within the main...
2
by: Johann Blake | last post by:
The following is a bug I have discovered using tab pages and threads and I am looking for a workaround. Create a new Windows Forms application and add a tab control with two tab pages. Add a...
5
by: Kieran Benton | last post by:
Hello, I'm currently in the tail end process of developing a high scalability server for my employer. Essentially it receives short socket based connections with an ASCII message, parses that...
1
by: Charles A. Lackman | last post by:
Hello, When I use Shell in VB.NET all works great. i.e. Shell("C:\Hogg.exe -n -pg") but when I use Dim MyProcess as Process = System.Diagnostics.Process.Start("C:\Hogg.exe -n -pg") I...
37
by: ales | last post by:
Hello, I have a problem with creation of new thread. The method .Start() of newly created thread delays current thread for 0 - 1 second. Cpu while delay occurs is about 5%. Any idea? Here...
4
by: Jamey Shuemaker | last post by:
A2k2 with user-level security and all preventive measures, vis a vis, Security FAQ enabled or enacted. I've got three DBs, which due to size constraints can't, or rather, probably shouldn't be...
29
by: AlFire | last post by:
Hi, I have a piece of software which uses threads in very massive way - like hundreds of them generated every second. there is also a piece of code which maintains the number of outstanding...
6
by: =?Utf-8?B?QnJlbmRhbiBLYXk=?= | last post by:
Hi there, We have an ASP.Net application that is generating huge numbers of Context Switches when a certain number of active users are present. We tried changing the configuration of the...
23
by: =?GB2312?B?0rvK18qr?= | last post by:
Hi all, Recently I had a new coworker. There is some dispute between us. The last company he worked for has a special networking programming model. They split the business logic into...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.