0

Sorry i dont want to do it but i did not get any answer here:

I want to run this code in vb: nc -l -p 1234 < installer.zip or ncat -l 1234 < installer.zip I tried this:

Dim p As New ProcessStartInfo
p.FileName = "Cmd.exe"
p.Arguments = "nc -l -p 1234 < installer.zip"
Process.Start(p)

And this too:

Process.Start("nc.exe", "-l -p 1234 < installer.zip")

but using either of them gives me error:

using netcat <: forward host lookup failed:h_errno 11004: NO_DATA using ncat Ncat: Got more than one port specification: 1234 < installer.zip. However if the same code(copy) is run through batch file it works.

0

3 Answers 3

1

p.Arguments must start with /c and a space; e.g.:

p.Arguments = "/c nc -l -p 1234 < installer.zip"
Sign up to request clarification or add additional context in comments.

Comments

0

Put your whole command in a batch file.

NC.BAT:

nc -l -p 1234 < installer.zip

then run the batch file from VB:

Process.Start("NC.BAT")

2 Comments

Thanks for reply, but is that the only way to do it. I mean i am making an app which will constantly (15-20 times a day) send text files having different names via net to another pc. So according to your method each time a new batch will have to be generated. I had found this:www.governmentsecurity.org/forum/topic/14098-netcat-gui/ but i was unable to register to download the attachment (Netcat_W.zip). If somone could do for me, it would be good.
You could easily create the batch within vb.net, and delete it after it had been launched? no big deal.
0

Thank you both Rubik and Bill_Stewart for your reply's. Both the methods work but i'll prefer Bill_Stewart one and mark this as answer:

p.Arguments must start with /c and a space; e.g.: p.Arguments = "/c nc -l -p 1234 < installer.zip"

1 Comment

Welcome to the Stack Overflow. There is a standard to mark most helpful answer as an answer. Mark your own answer only if other answers you received were not useful and later you found the solution on your own. Based on what you wrote, you should mark this answer. You can always re-assign the answer mark. You can also delete this answer because it only copies content of the other one. This site works differently from discussion forum–by posting answers, you are NOT adding posts under other answers = in this case,others haven't seen your "thank you" message.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.