1 Replies - 1211 Views - Last Post: 07 October 2012 - 12:06 PM Rate Topic: -----

#1 hossamezz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-October 12

How to run telnet in VB.Net

Posted 07 October 2012 - 10:38 AM

I have this code in VB Script and I want to write it but in VB.net.

VB Script is:

set oShell = CreateObject("WScript.Shell") 
oShell.run"cmd.exe" 
WScript.Sleep 100 
oShell.SendKeys"telnet 101.127.9.1 -f \\101.127.9.10\c$\Stordata\RouterType.txt" 
oShell.SendKeys("{Enter}") 
WScript.Sleep 300 
oShell.SendKeys"Password" 
oShell.SendKeys("{Enter}") 
WScript.Sleep 300 
oShell.SendKeys"show inventory" 
oShell.SendKeys("{Enter}") 
WScript.Sleep 300 
oShell.SendKeys"exit" 
oShell.SendKeys("{Enter}") 
oShell.SendKeys"exit" 
oShell.SendKeys("{Enter}") 
Set oShell = CreateObject("WScript.Shell") 
Set oWmg = GetObject("winmgmts:") 

strWndprs = "select * from Win32_Process where name='cmd.exe'" 
Set objQResult = oWmg.Execquery(strWndprs) 

For Each objProcess In objQResult 

intReturn = objProcess.Terminate(1) 


Next 



Is This A Good Question/Topic? 0
  • +

Replies To: How to run telnet in VB.Net

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5529
  • View blog
  • Posts: 11,846
  • Joined: 02-June 10

Re: How to run telnet in VB.Net

Posted 07 October 2012 - 12:06 PM

What have you tried/written so far?
What errors is your code producing?
You list "I want", but we aren't a code writing service. We will help you with your code. But you have to make some effort.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1