473,750 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MS-DOS Command Prompt questions

37 New Member
Hey folks!

First off, I don't know which section of the forum this needed to be so I put it in Windows since the majority of it is MS-DOS. Sorry if it's in the wrong section.


Now, I have a question, I'm trying to ping -a <IP_ADDRESS> a whole list of IP Addresses in command prompt then see if they are timing out or not and if they are timing out, return that results to a spreadsheet. Guys, I'm lost. I've been hearing I need to write a batch file, I need to write in C++, or get some kind of ultility tool to do it. Now, I can write a batch file to ping all these machines, but I don't know enough to know it has the ability to write back to a spreadsheet.

I come from a Java, JavaScript, and SQL background so I know little to noting about C++ and batch file creation. I know C++ is MUCH easier then Java to execute DOS commands, but I know Java can read from txt files and excel sheets for iteration lists like my thousands of IP addresses.

can anyone point me in the correct direction?

Thanks!
Oct 3 '07 #1
8 7249
udd
3 New Member
I dun knw abt spread sheet but dis is how u do in notepad...

hope it'll b useful for u ..


::This is a .bat(batch) file
::To copy output of a IP which is being pinged
::Demo for a single IP address
:Welcome
::
@Echo off

ping 10.10.10.10 > tempfile.txt
copy /-y destfile.txt+te mpfile.txt destfile.txt

:: remember you need to first create the file destfile.txt
::repeat this for all ip's (you work on that:))
::ask me if this is not what you wanted
Oct 24 '07 #2
Tuanisviet
37 New Member
No, that's great. Thanks a lot.

Can you tell me how can I write to notepad to add comments or lines. I don't need ECHO., but something to print out onto the notepad per ping.
Nov 13 '07 #3
epots9
1,351 Recognized Expert Top Contributor
No, that's great. Thanks a lot.

Can you tell me how can I write to notepad to add comments or lines. I don't need ECHO., but something to print out onto the notepad per ping.
in the example echo is turned off so nothing is displaced and the output it stored in a text file called tempfile.
Nov 13 '07 #4
udd
3 New Member
::This is a .bat(batch) file
::To copy output of a IP which is being pinged
::Demo for a single IP address
:Welcome
::

@Echo off

Echo "This is a comment" >tempfile1.tx t
::Put comments on tempfile1.txt for each ping information

ping 10.10.10.10 > tempfile.txt
::The comment from tempfile1.txt is being copied to the tempfile.txt

copy /y tempfile.txt+te mpfile1.txt tempfile.txt

copy /y destfile.txt+te mpfile.txt destfile.txt

:: remember you need to first create the file destfile.txt
::repeat this for all ip's (you work on that:))
::ask me if this is not what you wanted



I hope u can use this idea,if not tell me,I would try to help it out...:)
Regards,
Yudi
Dec 7 '07 #5
harshadd
176 New Member
Well, Windows is always # include MSDOS so not to worry you are at right forum..

Now about your query, I have a small piece of bat file code, which checks if your ping is going through for a said IP address, I used vsnl's dns server IP to ping and check the status of my internet (whether it is Up /Down)
If "Ping to VSNL DNS is through, that means my NET is UP" is the logic
here is the code:It works with dos promt u obtain in XP by running cmd.exe NOT MS DOS 6.22 or lower (NOT TESTED ON 2000)

@echo off
set op= Lost = 0 (0%% loss)
:TOP
FOR /F "skip=9 usebackq tokens=3 delims=," %%i in (`ping
202.54.1.18`) do if "%op%"=="%% i" goto HND
ipconfig /release
ipconfig /renew
goto TOP
:HND
:EXIT
Dec 7 '07 #6
Tuanisviet
37 New Member
Well, Windows is always # include MSDOS so not to worry you are at right forum..

Now about your query, I have a small piece of bat file code, which checks if your ping is going through for a said IP address, I used vsnl's dns server IP to ping and check the status of my internet (whether it is Up /Down)
If "Ping to VSNL DNS is through, that means my NET is UP" is the logic
here is the code:It works with dos promt u obtain in XP by running cmd.exe NOT MS DOS 6.22 or lower (NOT TESTED ON 2000)

@echo off
set op= Lost = 0 (0%% loss)
:TOP
FOR /F "skip=9 usebackq tokens=3 delims=," %%i in (`ping
202.54.1.18`) do if "%op%"=="%% i" goto HND
ipconfig /release
ipconfig /renew
goto TOP
:HND
:EXIT
Sorry for late reply, but this works wonders. Thanks for everyone's posts. :D
Feb 26 '08 #7
Aladdina
1 New Member
If you just want to have a log file for the result, you may need to use PowerCmd. You can have your logs automatically saved when you run a command or batch script file.
Mar 24 '08 #8
harshadd
176 New Member
If you just want to have a log file for the result, you may need to use PowerCmd. You can have your logs automatically saved when you run a command or batch script file.

Aladdina, 99.99% ppl come on blogs to see FREE of cost solutions... It will be appreciated if you could provide/suggest FREE utilities as a solution.
Mar 30 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

9
4245
by: CY FOK | last post by:
Hi I am planning to open a software company to develop client-server apps and web applications for my client. Now, i am in a difficult situation to determine what is the best platform i should use to develop the application for my end users. Should I use Java or MS.Net technology or should I mix both of them ? Basically, I have these criteria in mind before I decide which platform I should adopt : 1. Ease of use - which one is easy to...
11
3763
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows 2003 Server or ADO or ODBC issue, I am posting this on all of the three newsgroups. That's the setup: Windows 2003 Server with IIS and ASP.NET actiavted Access 2002 mdb file (and yes, proper rights are set on TMP paths and path,
18
2259
by: Rob R. Ainscough | last post by:
MS Visual Studio Ad contained in VS Magazine. Two developers in "hip" clothing diagramming out a huge flow chart on a beach. I could NOT stop laughing at the stupidity of the ad -- "Let your ideas run free"....only to be washed up by the waves when the tide comes in -- this is exactly so so so Microsoft. Re-invent the dev tools every 3-5 years in the name of progress and hope developers don't notice -- good revenue generation for MS,...
2
14931
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data in the format that I need it in order to create the reports that we use. So far this has proven to be successful for the reports that I am doing and the data that I am pulling into it. I just have one challenge that may require a lot of work and I...
1
2310
by: Mike_red | last post by:
Hello, I hope someone can solve my problem here. I am currently working/programming a website using Debian Linux + Perl + PHP + PostgreSQL + Apache. Some data in the postgreSQL server must be updated from a Microsft Access database once a week. The Micorosft Access database is running on a Windows NT 4 platform.
33
5952
by: Uwe Range | last post by:
Hi to all! A customer of mine told me some days ago that her IT-people told her ACCESS would not be such a good idea for continuing with our project, because Access will not be continued in the future. I haven't heard of this. Does anybody know more about it? The IT-People usually prefer Oracle. If they really want to go in this direction, could our Access-application (if continued) be used as a front end with an Oracle back end? Does...
0
2109
by: com | last post by:
MS Access 2000 Password Recoverer 4.2 Screenshot - Soft30.com MS Access 2000 Password Recoverer will display the password to a MS Access database (*.mdb). This program works for MS Access files saved in MS Access 2000. ... www.soft30.com/screen-149-12232.htm - 32k - Cached - Similar pages MS Access HTML Help Generator 1.2 - Soft.com MS Access HTML Help Generator 1.2. ... System Requirements: MS Access 2000 / XP /
1
3347
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ... www.soft30.com/download-1-11975.htm - 31k - Cached - Similar pages MDBSecure 1.0.8.0 - Soft30.com Utility which makes it easy to create secure MS Access Databases, ... MS Access 2000/2003 format. 30 day money back guarantee, 30 day trial. ...
22
6283
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one client (MS Access vs ..NET Windows Forms) would be preferred over the other. While I have some good arguments on both sides, I would appreciate your points of view on the topic.
1
1918
by: Ted | last post by:
I managed to get it installed OK, along side MS Visual Studio 2005 (with which I received it). During the install, I made sure I installed everything. I have developed a number of applications using MySQL v 5 and PostgreSQL, but I have not worked with MS SQL. Playing with it after installing it, and running through several tutorials, I generally like what I see, but there are a few issues (so far - I am sure others will crop up as...
0
8999
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9338
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4712
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.