Windows 7 Forums


Reply
Thread Tools

Cmd.exe / .bat help

 
 
nev3r nev3r is offline
New Member
Join Date: Oct 2010
Posts: 1
Thanked: 0
 
      10-09-2010
So I've been trying to make a .bat file that basically does this:
-find the IP of a user inputted website URL.
-take that value of w.x.y.z and input it into a web browser.
my main issue here is taking the outputted IP and putting it to use in the same .bat file.
also, the user input is a bit tricky, im kinda new at this.
any code / explanation to help me out?
right now im using win 7 but ill end up making it for XP so either or both versions would be helpful. thanks!

edit: also i just realized that this probably should go in the support forum, but at the time i was thinking support as in non-programming stuff, so.. sorry!

Last edited by nev3r; 10-09-2010 at 01:00 AM..
 
Reply With Quote
 
 
 
 
Ian Ian is offline
Administrator
Ian's Avatar
Join Date: Oct 2008
Location: England
Posts: 3,129
Thanked: 456
Ian's Twitter Pag
 
      10-10-2010
General discussion is probably fine for this, as it's more of a programming question than support issue .

I understand what you're trying to do, but I don't know the programming knowledge to create the code. I can suggest a few thing that may help though

First, you can use the following code to allow input of a domain:

Code:
SET /P PINGDOMAIN=Enter Domain:
Next you'll need to figure out a way to capture the IP of a domain that you enter in to the script. I guess using ping would be the easiest. You can then output the full result to a temp file:

Quote:
ping %PINGDOMAIN% > temp.txt
Then you'll need to capture the IP as a variable, using something like this and this to search through the temp.txt file and allow you to use the IP in the batch file. This is a little complicated the first time you use the command, but it's very logical to figure out - I'm sure there are some experts here that will know an easier way of captureing the IP.

Once you've got the IP stored as a variable, you can then just launch IE as follows (assuming %IPADDRESS% is your variable name):

Quote:
C:\Program Files\Internet Explorer\iexplore.exe %IPADDRESS%
 
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
infected cmd.exe msiexec removed Franky Four Fingers Security 2 10-09-2009 04:21 PM


All times are GMT +1. The time now is 11:05 PM.
W7Forums is an independent website and is not affiliated with Microsoft Corporation.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33