Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Subject: HELP! Running CMD command in VB

Original Message
Name: Eprouvez
Date: May 2, 2008 at 00:42:29 Pacific
Subject: HELP! Running CMD command in VB
OS: XP PRO
CPU/Ram: 768
Model/Manufacturer: Compaq
Comment:
Hey everyone!

I need some help and I would highly appriciate it if someone could help me with this.

I'm trying to make a website IP address finder, and I have the style and the method of getting it... But not the coding...

I have...
3 Labels
2 Textboxs
and 1 Button.

I want it to notice that there is a website in textbox1 (If no website then Button1.Enabled = False), and when button1 is clicked, it opens up CMD (But hidden!) and it types this in CMD : Ping "Website from textbox1" (Without Quotes). From there I want it to locate the IP address in CMD and Put it in Textbox2.

Can anyone help me?
Thanks!


Report Offensive Message For Removal

Response Number 1
Name: Razor2.3
Date: May 2, 2008 at 01:55:09 Pacific
Subject: HELP! Running CMD command in VB
Reply: (edit)
I donno, it sounds like homework. Especially since you never specified which VB.

Report Offensive Follow Up For Removal

Response Number 2
Name: Eprouvez
Date: May 2, 2008 at 14:49:23 Pacific
Subject: HELP! Running CMD command in VB
Reply: (edit)
Sorry about that, I'm using VB Express Edition 2008.
I want to analyze the code so I can get better... and make a website IP finder, haha. I'm having a hard time finding a good place for tutorials that I need.
And this isn't homework haha.

Report Offensive Follow Up For Removal

Response Number 3
Name: Razor2.3
Date: May 2, 2008 at 16:48:30 Pacific
Subject: HELP! Running CMD command in VB
Reply: (edit)
I know I've answered a similar question before, but I never have any luck with this site's search. (Am I the only one?)

Thankfully, I still have my example, so after putting in a few lines of my example code, I found the thread. The only other thing I'd add is nslookup would be better than ping.


Report Offensive Follow Up For Removal

Response Number 4
Name: Eprouvez
Date: May 2, 2008 at 21:55:24 Pacific
Subject: HELP! Running CMD command in VB
Reply: (edit)
Hey Razor,

Thanks for you post, I'm having a problem with the code. I've copied & Pasted it and it doesn't work =[

Can you tell me how to type in CMD using VB, How to hide CMD while it is finding the IP, and how to get the IP from CMD to VB (TextBox2) please??

This is the code I have so far...

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Button1.Enabled = True Then Shell("cmd.exe")
End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text = "www" Or TextBox1.Text = "http:/" Then Button1.Enabled = False
If TextBox1.Text = "www." Or TextBox1.Text = "http://" Then Button1.Enabled = True
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
End Class


Report Offensive Follow Up For Removal

Response Number 5
Name: Razor2.3
Date: May 2, 2008 at 22:55:48 Pacific
Subject: HELP! Running CMD command in VB
Reply: (edit)
It works perfectly for me. Just start a new Windows project, view the code of Form1, delete all of the text, then paste my example in. The Design View won't show anything, but you'll get a text box and button when you run it.

EDIT:
Can you tell me how to type in CMD using VB, How to hide CMD while it is finding the IP, and how to get the IP from CMD to VB (TextBox2) please??
Question 1 and 2 are answered in Private Sub Btn_Click, while question 3 is answered across the entire example, excluding Public Sub New and Private Sub Proc_Exited


Report Offensive Follow Up For Removal

Response Number 6
Name: Eprouvez
Date: May 4, 2008 at 02:02:25 Pacific
Subject: HELP! Running CMD command in VB
Reply: (edit)
Thanks Razor!
My computer's being gay and won't paste it properly, but I'll try copy the txt line to line, and see if that works, But that's some help.

Report Offensive Follow Up For Removal

Response Number 7
Name: Razor2.3
Date: May 4, 2008 at 11:02:04 Pacific
Subject: HELP! Running CMD command in VB
Reply: (edit)
Ah, you're using IE6. This site has some bugs when it comes to the pre tag that blow up in IE6. Try pasting it into WordPad first, then VS. Or get a different browser.

Report Offensive Follow Up For Removal

Response Number 8
Name: Eprouvez
Date: May 6, 2008 at 01:56:54 Pacific
Subject: HELP! Running CMD command in VB
Reply: (edit)
Thanks Razor!!!!!!!
I couldn't copy it properly so did it line for line and works like a charm!!!

To all other people out there, Razor is the best!!!

Thanks again!


Report Offensive Follow Up For Removal

Response Number 9
Name: Eprouvez
Date: May 9, 2008 at 22:01:23 Pacific
Subject: HELP! Running CMD command in VB
Reply: (edit)
The link to my IP Address Finder.

http://myfreefilehosting.com/f/3328...


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: HELP! Running CMD command in VB

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software



Version Tracker Pro
Keep your software current and secure, effortlessly

Click Here for a Free Scan

Driver Agent
Automatically find the latest drivers for your computer.
Click Here for a Free Scan



The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC