473,699 Members | 2,811 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 7245
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
4234
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
3757
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
2253
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
14921
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
2308
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
5943
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
2105
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
3341
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
6268
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
1914
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
8706
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
9199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9055
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8947
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
7787
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6552
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5891
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3076
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
3
2016
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.