Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

get public IP

584 views
Skip to first unread message

Tom Del Rosso

unread,
Mar 14, 2012, 1:09:44 AM3/14/12
to

Is there a way to get my public IP from a command line? I could use wget to
load a page from an IP-id website and parse the page, but something simpler
and not dependent on the format of the web page would be better.


--

Reply in group, but if emailing add one more
zero, and remove the last word.


John Gray

unread,
Mar 14, 2012, 2:11:57 AM3/14/12
to
Here's (an extract) of what I use:
set wgetfile=wget1134.exe
set forcmds=%wgetfile% -q -O - http://automation.whatismyip.com/n09230945.asp
for /f %%a in ('%forcmds%') do set curipad=%%a
if errorlevel 1 echo %~n0: errorlevel from WGET was %errorlevel%

For quite some time I have been trying to encourage the author of IP2 http://keir.net/ip2.html to produce a command-line version which writes one's external IP address to the console, which can be snaffled by a batch file - but no joy as yet. Perhaps if a few more interested people write to him this would give him the impetus?

foxidrive

unread,
Mar 14, 2012, 2:24:13 AM3/14/12
to
On 14/03/2012 17:11, John Gray wrote:
> On Wednesday, March 14, 2012 5:09:44 AM UTC, Tom Del Rosso wrote:
>> Is there a way to get my public IP from a command line? I could use wget to
>> load a page from an IP-id website and parse the page, but something simpler
>> and not dependent on the format of the web page would be better.
>>
>>
>
> Here's (an extract) of what I use:
> set wgetfile=wget1134.exe
> set forcmds=%wgetfile% -q -O - http://automation.whatismyip.com/n09230945.asp
> for /f %%a in ('%forcmds%') do set curipad=%%a
> if errorlevel 1 echo %~n0: errorlevel from WGET was %errorlevel%
>
> For quite some time I have been trying to encourage the author of IP2 http://keir.net/ip2.html to produce a command-line version which writes one's external IP address to the console, which can be snaffled by a batch file - but no joy as yet. Perhaps if a few more interested people write to him this would give him the impetus?

Maybe you can Telnet into the modem/router and extract the info?


--
Mic

Tom Del Rosso

unread,
Mar 14, 2012, 2:36:48 AM3/14/12
to

John Gray wrote:
>
> Here's (an extract) of what I use:
> set wgetfile=wget1134.exe
> set forcmds=%wgetfile% -q -O -
> http://automation.whatismyip.com/n09230945.asp
> for /f %%a in ('%forcmds%') do set curipad=%%a
> if errorlevel 1 echo %~n0: errorlevel from WGET was %errorlevel%

Thanks. I suppose the page format won't change, but what about the asp
name?


> For quite some time I have been trying to encourage the author of IP2
> http://keir.net/ip2.html to produce a command-line version which
> writes one's external IP address to the console, which can be
> snaffled by a batch file - but no joy as yet. Perhaps if a few more
> interested people write to him this would give him the impetus?

I wonder how his program uses whois.geektools.com when they use a
graphic-text-entry-thing. (The term for that escapes me right now.)

Auric__

unread,
Mar 14, 2012, 3:49:18 AM3/14/12
to
Tom Del Rosso wrote:

> Is there a way to get my public IP from a command line? I could use
> wget to load a page from an IP-id website and parse the page, but
> something simpler and not dependent on the format of the web page would
> be better.

I solved this a different manner than Mr. Gray did -- I wrote a PHP script
and uploaded it to a free webhost (altervista.org):

<? print $_SERVER['REMOTE_ADDR']; ?>

(Pretty much any server-side language will work, but PHP is what I know.)

Now, all I have to do is wget it and I have my IP address in plain text. From
there, it's simple to get the IP into a variable:
wget http://.../showip.php
for /f %x in ('type showip.php') do set myip=%x

No text mangling required, and no reliance on someone else's URL, etc. not
changing. (If *my* URL ever changes -- which has happened, free webhosts
being what they are -- it's just a matter of editing my local script.)

--
- Will you stop saying what I'm thinking?
- Well, someone has to.

foxidrive

unread,
Mar 14, 2012, 3:52:05 AM3/14/12
to
With this tool I can extract the WAN IP address directory from my 'Billion' model router.

Telnet Scripting Tool v.1.0
by Albert Yale a...@aci.qc.ca http://ay.home.ml.org/

This batch file puts the telnet session in a file called "%temp%\getip.info"

@echo off
tst10.exe /r:getip.script /o:"%temp%\getip.info"

And the getip.script file follows - it is likely to differ from modem to modem. 192.168.1.254 is the LAN address of my modem. Port 23 is the telnet port.

192.168.1.254 23
WAIT "Login:"
SEND "admin\m"
WAIT "Password:"
SEND "MyPassword\m"
WAIT "admin>"
SEND "ip list interfaces\m"
WAIT "admin>"






--
Mic

Timo Salmi

unread,
Mar 14, 2012, 12:39:15 PM3/14/12
to
On 14.03.2012 07:09 Tom Del Rosso wrote:
> Is there a way to get my public IP from a command line?

133} How do I get the current IP address, number and name?
http://www.netikka.net/tsneti/info/tscmd133.php

All the best, Timo

--
Prof. (emer.) Timo Salmi, Vaasa, Finland
https://twitter.com/TimoSalmi
http://www.netikka.net/tsneti/homepage.php
Useful CMD script tricks http://www.netikka.net/tsneti/info/tscmd.php

Petr Laznovsky

unread,
Mar 14, 2012, 1:30:31 PM3/14/12
to
On 14.3.2012 17:39, Timo Salmi wrote:
> On 14.03.2012 07:09 Tom Del Rosso wrote:
>> Is there a way to get my public IP from a command line?
>
> 133} How do I get the current IP address, number and name?
> http://www.netikka.net/tsneti/info/tscmd133.php
>
> All the best, Timo
>

The question is on PUBLIC IP

L.

Timo Salmi

unread,
Mar 14, 2012, 2:19:35 PM3/14/12
to
On 14.03.2012 19:30 Petr Laznovsky wrote:
> On 14.3.2012 17:39, Timo Salmi wrote:
>> 133} How do I get the current IP address, number and name?
>> http://www.netikka.net/tsneti/info/tscmd133.php
> The question is on PUBLIC IP

Did you also check the latter part of the item?

foxidrive

unread,
Mar 14, 2012, 2:58:20 PM3/14/12
to
On 15/03/2012 03:39, Timo Salmi wrote:
> On 14.03.2012 07:09 Tom Del Rosso wrote:
>> Is there a way to get my public IP from a command line?
>
> 133} How do I get the current IP address, number and name?
> http://www.netikka.net/tsneti/info/tscmd133.php
>
> All the best, Timo
>

One aspect of the first item, Timo:

nslookup doesn't return anything useful on my XP machine.

c:\>nslookup 192.168.1.103
Server: home.gateway
Address: 192.168.1.254

Name: 192-168-1-103.tpgi.com.au
Address: 192.168.1.103





I did implement Auric's concise suggestion here: http://astronomy.comoj.com/ip.php
and it works well, thanks.



--
Mic

Timo Salmi

unread,
Mar 14, 2012, 3:32:00 PM3/14/12
to
On 14.03.2012 20:58 foxidrive wrote:
> One aspect of the first item, Timo:
> nslookup doesn't return anything useful on my XP machine.

> c:\>nslookup 192.168.1.103
> Server: home.gateway
> Address: 192.168.1.254

AFAIK it is not the fault of your PC, but it depends on your ADSL.
192.168.1.xxx would seem to be the local workgroup IPs.

> I did implement Auric's concise suggestion here: http://astronomy.comoj.com/ip.php
> and it works well, thanks.

Right. Like the solution in the second part of my item. Click the links
in my sig and you'll a similar outcome.

All the best, Timo

--
Prof. (emer.) Timo Salmi, Vaasa, Finland

foxidrive

unread,
Mar 14, 2012, 4:07:07 PM3/14/12
to
On 15/03/2012 06:32, Timo Salmi wrote:
> On 14.03.2012 20:58 foxidrive wrote:
>> One aspect of the first item, Timo:
>> nslookup doesn't return anything useful on my XP machine.
>
>> c:\>nslookup 192.168.1.103
>> Server: home.gateway
>> Address: 192.168.1.254
>
> AFAIK it is not the fault of your PC, but it depends on your ADSL.
> 192.168.1.xxx would seem to be the local workgroup IPs.

Yes, that is the LAN IP.


>> I did implement Auric's concise suggestion here: http://astronomy.comoj.com/ip.php
>> and it works well, thanks.
>
> Right. Like the solution in the second part of my item. Click the links
> in my sig and you'll a similar outcome.

Yep. I haven't ever delved into php so this was like pasting my first

echo hello world

in php. :)



--
Mic

John Gray

unread,
Mar 14, 2012, 4:28:16 PM3/14/12
to
That http://automation.whatismyip.com/n09230945.asp page has been quite constant over the last year or two, but has changed from an earlier version. Have a look at their webpage (well hidden!) which talks about it: http://www.whatismyip.com/faq/automation.asp

Of all the External IP Displayers that I found when I wrote the batch file, viz.
:: http://whatismyip.com
:: http://whatismyipaddress.com
:: http://checkip.dyndns.org
:: http://checkip.dyndns.org:8245
:: http://checkip.org
:: http://www.ipaddresslocation.org
:: http://showmyip.com
:: http://www.dslreports.com/whois
the page I used is the cleanest in providing the external IP address and no more.

I'm afraid I have no ideas about the GeekTools thing. Perhaps a question for Mr Keir?

Petr Laznovsky

unread,
Mar 14, 2012, 6:12:36 PM3/14/12
to
On 14.3.2012 19:19, Timo Salmi wrote:
> On 14.03.2012 19:30 Petr Laznovsky wrote:
>> On 14.3.2012 17:39, Timo Salmi wrote:
>>> 133} How do I get the current IP address, number and name?
>>> http://www.netikka.net/tsneti/info/tscmd133.php
>> The question is on PUBLIC IP
>
> Did you also check the latter part of the item?
>
> All the best, Timo
>

This part of the item expect access to machine running php and lies
outside of your private network, am I right? If yes, than this is too
far from first question...

L.

Auric__

unread,
Mar 14, 2012, 6:27:34 PM3/14/12
to
Timo Salmi wrote:

> On 14.03.2012 19:30 Petr Laznovsky wrote:
>> On 14.3.2012 17:39, Timo Salmi wrote:
>>> 133} How do I get the current IP address, number and name?
>>> http://www.netikka.net/tsneti/info/tscmd133.php
>> The question is on PUBLIC IP
>
> Did you also check the latter part of the item?
>
> All the best, Timo

Huh. Well, I never claimed that my solution was unique, or even original...

--
Look at the size of your bath. I can pee in it and you'd never notice.

Auric__

unread,
Mar 14, 2012, 6:30:32 PM3/14/12
to
Petr Laznovsky wrote:

> On 14.3.2012 19:19, Timo Salmi wrote:
>> On 14.03.2012 19:30 Petr Laznovsky wrote:
>>> On 14.3.2012 17:39, Timo Salmi wrote:
>>>> 133} How do I get the current IP address, number and name?
>>>> http://www.netikka.net/tsneti/info/tscmd133.php
>>> The question is on PUBLIC IP
>>
>> Did you also check the latter part of the item?
>
> This part of the item expect access to machine running php and lies
> outside of your private network, am I right? If yes, than this is too
> far from first question...

Not really. foxidrive pointed out that if you can telnet into your router,
you can script that... but for those that *can't* (like me) the version I use
is probably the simplest.

--
Satan makes everything more fun.

Auric__

unread,
Mar 14, 2012, 6:32:43 PM3/14/12
to
foxidrive wrote:

> On 15/03/2012 06:32, Timo Salmi wrote:
>> On 14.03.2012 20:58 foxidrive wrote:
[snip]
>>> I did implement Auric's concise suggestion here:
>>> http://astronomy.comoj.com/ip.php and it works well, thanks.

You're welcome.

>> Right. Like the solution in the second part of my item. Click the links
>> in my sig and you'll a similar outcome.
>
> Yep. I haven't ever delved into php so this was like pasting my first
>
> echo hello world
>
> in php. :)

It's actually my first published PHP script of any kind. ;-)

--
Release the helpdesk hellhounds!

tonysathre

unread,
Mar 14, 2012, 6:47:25 PM3/14/12
to
Something like this works:

@echo off
>_.vbs echo set x=WScript.CreateObject("WScript.Shell")
>>_.vbs echo x.SendKeys "GET /ip.php HTTP/1.1"
>>_.vbs echo x.SendKeys "{enter}"
>>_.vbs echo x.SendKeys "host:www.checkip.altervista.org"
>>_.vbs echo x.SendKeys "{enter 2}"
start telnet www.checkip.altervista.org 80
cscript //nologo _.vbs & del _.vbs

I tried using start telnet -f logfile.txt but it only saves the HTTP response header and not the output from the ip.php. If someone can figure that out, that would be great.

Tony

foxidrive

unread,
Mar 14, 2012, 7:41:23 PM3/14/12
to
I get a advert web page at www.checkip.altervista.org


--
Mic

Alkane

unread,
Mar 14, 2012, 8:28:46 PM3/14/12
to
The full URL is www.checkip.altervista.org/ip.php

Tony

Auric__

unread,
Mar 14, 2012, 8:33:27 PM3/14/12
to
Telnet's no good. Use wget:
wget http://.../ip.php

Here's the one that I use:
http://opensourcepack.blogspot.com/2010/05/wget-112-for-windows.html
...but his dropbox has been "retired" (too much traffic). I've mirrored it
here (498,839 bytes):
http://auric.altervista.org/wget-1.13.4-exe.7z

You can find an older version of wget (1.11.4 from 3 years ago) at the
GNUWin32 project:
http://gnuwin32.sourceforge.net/packages/wget.htm

Alternately, if you have PowerShell (script from superuser.com/a/330754):
$client = new-object System.Net.WebClient
$client.DownloadFile("http://.../ip.php","C:\tmp\my.ip")

I've also put my PHP script here if anyone wants to use it for their scripts:
http://auric.altervista.org/public_ip.php
http://auric.altervista.org/public_ip.php.src
(They're the same thing, but ".src" prevents the server from interpreting the
PHP code.)

--
Excuse me for sticking to my principles.

Alkane

unread,
Mar 14, 2012, 8:38:12 PM3/14/12
to
I never use tools in scripts unless they're built in.

foxidrive

unread,
Mar 14, 2012, 9:03:00 PM3/14/12
to
On 15/03/2012 11:38, Alkane wrote:
> I never use tools in scripts unless they're built in.

You can't have been around in MSdos days when you were happy to have tools.


Seriously, the only reason not to use tools is if you have a corporate policy that forbids them.


--
Mic

Auric__

unread,
Mar 14, 2012, 9:35:23 PM3/14/12
to
Alkane wrote:

> I never use tools in scripts unless they're built in.

I'm largely a Linux user, where the number of tools "built in" is defined by
who's putting the distro together... and wget has been a standard part of the
*nix world for several years.

If you really, truly don't want wget, then you can try downloading via
VBScript. This page:
http://www.robvanderwoude.com/vbstech_internet_download.php
...has a VBScript to download a file.

--
- I'm subtle.
- Like a moose.

Tony Sathre

unread,
Mar 14, 2012, 10:35:20 PM3/14/12
to
On Mar 14, 8:03 pm, foxidrive <foxidr...@gotcha.woohoo.invalid> wrote:
I misstated what I meant. I use plenty of tools but I prefer, and
always looks for ways to do things without them. I wouldn't be able to
do my job without them, but sometimes it's funner to look for
solutions that don't require them.

Timo Salmi

unread,
Mar 15, 2012, 3:26:18 AM3/15/12
to
On 14.03.2012 22:07 foxidrive wrote:
> On 15/03/2012 06:32, Timo Salmi wrote:
>> AFAIK it is not the fault of your PC, but it depends on your ADSL.
>> 192.168.1.xxx would seem to be the local workgroup IPs.
> Yes, that is the LAN IP.

>>> I did implement Auric's concise suggestion here: http://astronomy.comoj.com/ip.php
>>> and it works well, thanks.
>> Right. Like the solution in the second part of my item. Click the links
>> in my sig and you'll a similar outcome.

And, if and when one has several PCs attached to the same router, all
will show the same external IP.

foxidrive

unread,
Mar 15, 2012, 3:34:44 AM3/15/12
to
On 15/03/2012 13:35, Tony Sathre wrote:
>>
> I misstated what I meant. I use plenty of tools but I prefer, and
> always looks for ways to do things without them. I wouldn't be able to
> do my job without them, but sometimes it's funner to look for
> solutions that don't require them.

For the love of the chase, eh? Batch file speaking.


It is great fun to see WSH pushed into action when the alternate is to rely on a package.

An example here is Dostips forum: http://www.dostips.com/forum/viewtopic.php?f=3&t=3056&view=unread#unread

The OP has changed the spec since, but the task originally was to copy all images of 100x50 resolution. That was solved with a script relying on Irfanview to give a list of images and resolution, and then user aGerman ponied up a script to do it easily in WSH.

Very handy!


--
Mic

foxidrive

unread,
Mar 15, 2012, 3:45:24 AM3/15/12
to
On 15/03/2012 18:26, Timo Salmi wrote:
> On 14.03.2012 22:07 foxidrive wrote:
>> On 15/03/2012 06:32, Timo Salmi wrote:
>>> AFAIK it is not the fault of your PC, but it depends on your ADSL.
>>> 192.168.1.xxx would seem to be the local workgroup IPs.
>> Yes, that is the LAN IP.
>
>>>> I did implement Auric's concise suggestion here: http://astronomy.comoj.com/ip.php
>>>> and it works well, thanks.
>>> Right. Like the solution in the second part of my item. Click the links
>>> in my sig and you'll a similar outcome.
>
> And, if and when one has several PCs attached to the same router, all
> will show the same external IP.
>
> All the best, Timo
>

Yes, the router shares the WAN IP via Network Address Translation. Damn handy that - can you imagine if each PC needed it's own WAN IP? We'd be on IPv200 by now. ;)


--
Mic

Tony Sathre

unread,
Mar 15, 2012, 5:08:01 AM3/15/12
to
Yep. For me the whole point to writing a script is to create my own
tool rather than relying on something someone else created. You don't
learn anything from downloading and running a binary, my opinion of
course.

Frank P. Westlake

unread,
Mar 15, 2012, 10:11:16 AM3/15/12
to
On 2012-03-14 19:35, Tony Sathre wrote:
> I use plenty of tools but I prefer, and
> always looks for ways to do things without them.

Good policy. I've learned through the years that it is much better to
create a long-term solution by using only what the OS provides by
default, and without making use of a bug or an undocumented feature
which might someday be changed. Everything changes eventually -- we no
longer have EDLIN, DEBUG, and other 16-bit solutions -- but using only
the default tools makes the solution last longer.

Frank

foxidrive

unread,
Mar 15, 2012, 10:28:39 AM3/15/12
to
On 16/03/2012 01:11, Frank P. Westlake wrote:
> On 2012-03-14 19:35, Tony Sathre wrote:
>> I use plenty of tools but I prefer, and
>> always looks for ways to do things without them.
>
> Good policy. I've learned through the years that it is much better to
> create a long-term solution by using only what the OS provides by
> default, and without making use of a bug or an undocumented feature
> which might someday be changed.

That would rule out much of the cmd techniques we currently use, Frank.

> Everything changes eventually -- we no
> longer have EDLIN, DEBUG, and other 16-bit solutions -- but using only
> the default tools makes the solution last longer.

And we have powershell now which is presumably pretty powerful - I haven't delved into it much myself.



--
Mic

Petr Laznovsky

unread,
Mar 15, 2012, 10:30:32 AM3/15/12
to
Second reason is to made scripts for distribution to the world, where
you can`t expect such tool was present


foxidrive

unread,
Mar 15, 2012, 10:43:55 AM3/15/12
to
But some tools like Sed, Gawk/Awk, wget are just too handy not to have around.


As for writing scripts: you or I may be able to write a much more convoluted script to solve a given task, where using a tool such as SED might make it a 3 liner. You *then* have to consider the learning curve for those using the script, where a much more convoluted script is harder to maintain, understand and modify.

As an example, I've written some very convoluted scripts and enjoyed doing it, and using them are generally simple - but even the author of a complex script can be lost at sea if it comes to modifying a script that you've had for years. Simplicity is what I try for a lot of the time now.


--
Mic

Frank P. Westlake

unread,
Mar 15, 2012, 10:53:22 AM3/15/12
to
On 2012-03-15 07:28, foxidrive wrote:

> On 16/03/2012 01:11, Frank P. Westlake wrote:
>> I've learned through the years that it is much better to ...

> That would rule out much of the cmd techniques we currently use, Frank.

How so? "SET/P" can be used to print text without a line ending -- an
undocumented result of how SET/P works. I use it because it is the best
built-in method of printing without a line ending. It is not "ruled out"
as a solution. Are you reading an absolute in my statement that is not
there?

> And we have powershell now which is presumably pretty powerful - I haven't delved into it much myself.

Nor I. PowerShell seems to me to be a complex solution when most of the
time we need and want only a simple solution. A system administrator is
busy with many things and the PowerShell syntax takes too much time to
get good at to be useful only as an occasional tool. I bet most
PowerShell users only copy scripts that others have published.

Frank

foxidrive

unread,
Mar 15, 2012, 11:09:15 AM3/15/12
to
On 16/03/2012 01:53, Frank P. Westlake wrote:
> On 2012-03-15 07:28, foxidrive wrote:
>
>> On 16/03/2012 01:11, Frank P. Westlake wrote:
>>> Good policy. I've learned through the years that it is much better to
>>> create a long-term solution by using only what the OS provides by
>>> default, and without making use of a bug or an undocumented feature
>>> which might someday be changed.

>> That would rule out much of the cmd techniques we currently use, Frank.
>
> How so? "SET/P" can be used to print text without a line ending

What makes you think of set /p in that way?


> Are you reading an absolute in my statement that is not there?

Your statement says 'without using a bug or an undocumented feature'. Now if that isn't an absolute them I'll go he.




--
Mic

Frank P. Westlake

unread,
Mar 15, 2012, 11:26:19 AM3/15/12
to
On 2012-03-15 08:09, foxidrive wrote:
> Your statement says 'without using a bug or an undocumented feature'.
> Now if that isn't an absolute them I'll go he.

I wrote

... it is much better ..., and without ....

It would be an absolute if I wrote

... you should only ..., and without ....

Frank

tonysathre

unread,
Mar 15, 2012, 3:23:39 PM3/15/12
to
Apparently my last post didn't publish correctly so I'll try it again:

This worked for me perfectly on a Windows 7 x64 box using only built-ins:

@echo off & if defined ip set ip=
>_.vbs echo set x=WScript.CreateObject("WScript.Shell")
>>_.vbs echo x.SendKeys "GET /ip.php HTTP/1.1"
>>_.vbs echo x.SendKeys "{enter}"
>>_.vbs echo x.SendKeys "host:www.checkip.altervista.org"
>>_.vbs echo x.SendKeys "{enter 2}"
>>_.vbs echo Wscript.Sleep "400"
>>_.vbs echo x.SendKeys "{enter}"
start telnet -f ip.txt -t vt52 www.checkip.altervista.org 80
cscript //nologo _.vbs & del _.vbs
for /f %%i in ('type ip.txt') do set ip=%%i
echo %ip%&del ip.txt > nul

You may have to play with the Sleep if it doesn't work.

Tony

tonysathre

unread,
Mar 15, 2012, 2:48:34 PM3/15/12
to
This is working perfect on my Windows 7 x64 box using only built-ins:

@echo off & if defined ip set ip=
>_.vbs echo set x=WScript.CreateObject("WScript.Shell")
>>_.vbs echo x.SendKeys "GET /ip.php HTTP/1.1"
>>_.vbs echo x.SendKeys "{enter}"
>>_.vbs echo x.SendKeys "host:www.checkip.altervista.org"
>>_.vbs echo x.SendKeys "{enter 2}"
>>_.vbs echo Wscript.Sleep "400"
>>_.vbs echo x.SendKeys "{enter}"
start telnet -f ip.txt -t vt52 www.checkip.altervista.org 80
cscript //nologo _.vbs & del _.vbs
for /f %%i in ('type ip.txt') do set ip=%%i
echo %ip%&del ip.txt > nul

You may have to adjust the Sleep timeout on your system.

Tony

Tom Del Rosso

unread,
Mar 15, 2012, 4:57:30 PM3/15/12
to

foxidrive wrote:
> On 15/03/2012 11:38, Alkane wrote:
> > I never use tools in scripts unless they're built in.
>
> You can't have been around in MSdos days when you were happy to have
> tools.

I used to wonder if the people at MS used their own command.com or ced.


--

Reply in group, but if emailing add one more
zero, and remove the last word.


Todd Vargo

unread,
Mar 16, 2012, 10:37:20 PM3/16/12
to
On 3/15/2012 3:57 PM, Tom Del Rosso wrote:
> foxidrive wrote:
>> On 15/03/2012 11:38, Alkane wrote:
>>> I never use tools in scripts unless they're built in.
>>
>> You can't have been around in MSdos days when you were happy to have
>> tools.
>
> I used to wonder if the people at MS used their own command.com or ced.

Of course they do, but they also use add-ons to extend beyond its limits.

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)

Michael Bednarek

unread,
Mar 16, 2012, 11:08:51 PM3/16/12
to
On Thu, 15 Mar 2012 07:11:16 -0700, Frank P. Westlake wrote in
alt.msdos.batch.nt:
You are twice wrong about EDLIN and DEBUG: 1) if it were true that "we
no longer have them", that would undermine your own argument; 2) we
still have them:

$ ver
Microsoft Windows [Version 6.1.7601] (that's Windows 7)

$ wmic os get Caption,CSDVersion /value
Caption=Microsoft Windows 7 Professional
CSDVersion=Service Pack 1

$ dir %windir\system32\edlin*;debug*
14/07/2009 07:40 20,634 debug.exe
14/07/2009 07:40 12,642 edlin.exe

Compare the baroque solutions in the recent "DIR /R show full path"
thread with "lads.exe". Anything involving string manipulation or
calculations requires bizarre syntax structures in cmd.exe; anything
requiring locale-independent date/time calulations is nigh impossible.

The "I can do it all with CMD" attitude is fine for the home tinker; at
work, I need serious tools for serious work.

--
Michael Bednarek "ONWARD"

Frank P. Westlake

unread,
Mar 17, 2012, 9:09:08 AM3/17/12
to
On 2012-03-16 20:08, Michael Bednarek wrote:

> You are twice wrong about EDLIN and DEBUG:
$ ver
Microsoft Windows [Version 6.1.7601]

$ wmic os get Caption,CSDVersion /value
Caption=Microsoft Windows 7 Home Premium
CSDVersion=Service Pack 1

$ where edlin* debug*
INFO: Could not find files for the given pattern(s).

> The "I can do it all with CMD" attitude is fine for the home tinker; at
> work, I need serious tools for serious work.

I don't have that attitude, nor have I suggested or recommended it. My
statement was that it is BETTER to use a built-in solution instead of
something else, which means to use the "something else" when the
"built-in solution" does not exist.

Frank

foxidrive

unread,
Mar 17, 2012, 9:25:41 AM3/17/12
to
You got ripped off, Frank!

===[paste]===
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\dos>debug /?
Runs Debug, a program testing and editing tool.

DEBUG [[drive:][path]filename [testfile-parameters]]

[drive:][path]filename Specifies the file you want to test.
testfile-parameters Specifies command-line information required by
the file you want to test.

After Debug starts, type ? to display a list of debugging commands.

C:\Users\dos>edlin /?
Starts Edlin, a line-oriented text editor.

EDLIN [drive:][path]filename [/B]

/B Ignores end-of-file (CTRL+Z) characters.
===[paste]===



--
Mic

Frank P. Westlake

unread,
Mar 17, 2012, 9:38:06 AM3/17/12
to
On 2012-03-17 06:25, foxidrive wrote:
> On 18/03/2012 00:09, Frank P. Westlake wrote:
>> $ wmic os get Caption,CSDVersion /value
>> Caption=Microsoft Windows 7 Home Premium
>> CSDVersion=Service Pack 1

> You got ripped off, Frank!

> Microsoft Windows [Version 6.1.7601]

Is that also Home Premium?

Frank

foxidrive

unread,
Mar 17, 2012, 9:43:49 AM3/17/12
to

foxidrive

unread,
Mar 17, 2012, 9:58:34 AM3/17/12
to
It's the bitness. 32 bit has them, 64 bit doesn't.


--
Mic

Frank P. Westlake

unread,
Mar 17, 2012, 10:07:14 AM3/17/12
to
On 2012-03-17 06:43, foxidrive wrote:
> On 18/03/2012 00:38, Frank P. Westlake wrote:
>> On 2012-03-17 06:25, foxidrive wrote:
>>> On 18/03/2012 00:09, Frank P. Westlake wrote:
>>>> $ wmic os get Caption,CSDVersion /value
>>>> Caption=Microsoft Windows 7 Home Premium
>>>> CSDVersion=Service Pack 1
>>
>>> You got ripped off, Frank!
>>
>>> Microsoft Windows [Version 6.1.7601]
>>
>> Is that also Home Premium?

> http://pcsupport.about.com/od/commandlinereference/tp/windows-7-commands-p1.04.htm

Quoting from that and the next page:

Debug
The debug command starts Debug, a command line application used to
test and edit programs.

The debug command is not available in 64-bit versions of Windows 7.

Edlin
The edlin command starts the Edlin tool which is used to create and
modify text files from the command line.

The edit[sic] is not available in 64-bit versions of Windows 7.

That is what I assumed and tried to indicate in my original message on
this topic:

... we no longer have EDLIN, DEBUG, and other 16-bit solutions ...

The 64-bit OS is replacing the 32-bit OS and has replaced the 16-bit OS
and the 8-bit OS. So with the 128-bit OS I expect that we might lose
32-bit tools.

Frank

Frank P. Westlake

unread,
Mar 17, 2012, 10:08:17 AM3/17/12
to
On 2012-03-17 06:58, foxidrive wrote:
> It's the bitness. 32 bit has them, 64 bit doesn't.

Yes, it was a bitter decision.

Frank

Michael Bednarek

unread,
Mar 18, 2012, 1:27:40 AM3/18/12
to
On Sat, 17 Mar 2012 07:07:14 -0700, Frank P. Westlake wrote in
alt.msdos.batch.nt:

[snip]
>That is what I assumed and tried to indicate in my original message on
>this topic:
>
> ... we no longer have EDLIN, DEBUG, and other 16-bit solutions ...
>
>The 64-bit OS is replacing the 32-bit OS and has replaced the 16-bit OS
>and the 8-bit OS. So with the 128-bit OS I expect that we might lose
>32-bit tools.

There are many good reasons not (yet) to take the route of 64-bit
Windows; Microsoft's own advice regarding its flagship Office Suite is
one.

Re 128-bit: need to address more than 2^64 bytes (~16.8 million
terabytes)? What are you smoking?

--
Michael Bednarek "ONWARD"

Frank P. Westlake

unread,
Mar 18, 2012, 8:48:10 AM3/18/12
to
On 2012-03-17 22:27, Michael Bednarek wrote:
> There are many good reasons not (yet) to take the route of 64-bit
> Windows; Microsoft's own advice regarding its flagship Office Suite is
> one.

There are many more reasons to use Linux instead.

> Re 128-bit: need to address more than 2^64 bytes (~16.8 million
> terabytes)? What are you smoking?

From this comment and your previous comments I suspect that you would
have had the same doubt about 64-bit architecture thirty years ago.

Frank

Michael Bednarek

unread,
Mar 19, 2012, 1:54:52 AM3/19/12
to
On Sun, 18 Mar 2012 05:48:10 -0700, Frank P. Westlake wrote in
alt.msdos.batch.nt:

>On 2012-03-17 22:27, Michael Bednarek wrote:
>> There are many good reasons not (yet) to take the route of 64-bit
>> Windows; Microsoft's own advice regarding its flagship Office Suite is
>> one.
>
>There are many more reasons to use Linux instead.

Non sequitur - you were writing about EDLIN and DEBUG in the Windows
world.

>> Re 128-bit: need to address more than 2^64 bytes (~16.8 million
>> terabytes)? What are you smoking?
>
> From this comment and your previous comments I suspect that you would
>have had the same doubt about 64-bit architecture thirty years ago.

Thirty years ago, that was a valid position. A 128-bit address scheme
could address more storage than is installed on all computers in the
world combined.

--
Michael Bednarek "ONWARD"

Frank P. Westlake

unread,
Mar 19, 2012, 9:20:37 AM3/19/12
to
On 2012-03-18 22:54, Michael Bednarek wrote:
> A 128-bit address scheme could address more storage
> than is installed on all computers in the
> world combined.

I don't think it is necessary for a computer to have access to all that
it is able to address, and it is not required that computers always in
the future will use the same type of storage media they now use.

Frank

Dr J R Stockton

unread,
Mar 20, 2012, 2:40:45 PM3/20/12
to
In alt.msdos.batch.nt message <jk7bra$qqu$1...@news.albasani.net>, Mon, 19
Mar 2012 06:20:37, Frank P. Westlake <frank.w...@gmail.net> posted:
I don't think it's worth stopping at 128-bit addressing - a 256-bit
address is about sufficient to address every particle in the observable
universe, and 256 bits is a nicer size for data than 128 bits.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms and links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

Frank P. Westlake

unread,
Mar 21, 2012, 8:41:38 AM3/21/12
to
On 2012-03-20 11:40, Dr J R Stockton wrote:
> In alt.msdos.batch.nt message<jk7bra$qqu$1...@news.albasani.net>, Mon, 19
> Mar 2012 06:20:37, Frank P. Westlake<frank.w...@gmail.net> posted:
>
>> On 2012-03-18 22:54, Michael Bednarek wrote:
>>> A 128-bit address scheme could address more storage
>>> than is installed on all computers in the
>>> world combined.
>>
>> I don't think it is necessary for a computer to have access to all that
>> it is able to address, and it is not required that computers always in
>> the future will use the same type of storage media they now use.
>
> I don't think it's worth stopping at 128-bit addressing - a 256-bit
> address is about sufficient to address every particle in the observable
> universe, and 256 bits is a nicer size for data than 128 bits.

But what if you only want to address 2^65?

Frank

Tom Del Rosso

unread,
Mar 21, 2012, 9:23:53 AM3/21/12
to
Expanded memory card.

Frank P. Westlake

unread,
Mar 21, 2012, 9:32:47 AM3/21/12
to
On 2012-03-21 06:23, Tom Del Rosso wrote:
> Frank P. Westlake wrote:
>> But what if you only want to address 2^65?
>
> Expanded memory card.

An expanded "memory card"? But what if it's then too wide for your
computer? A narrower card with more bits would be better.

Frank

foxidrive

unread,
Mar 21, 2012, 9:53:47 AM3/21/12
to
Quantum computer exanded memory cards are universally sized.

--
Mic

Frank P. Westlake

unread,
Mar 21, 2012, 9:58:44 AM3/21/12
to
On 2012-03-21 06:53, foxidrive wrote:
> Quantum computer exanded memory cards are universally sized.

Universally sized? But then they would have to have 256-bit architecture
as Doc Clock suggested.

Frank

Tom Del Rosso

unread,
Mar 21, 2012, 9:55:49 AM3/21/12
to
I used to have one that was only a foot long.

foxidrive

unread,
Mar 21, 2012, 10:06:07 AM3/21/12
to
Didn't you get the spec sheet? They auto-detect the bitness...


--
Mic

Frank P. Westlake

unread,
Mar 21, 2012, 10:39:29 AM3/21/12
to
No, I don't have a quantum computer. Besides, I thought quantum
computers used base 3 instead of base 2, so they wouldn't be bits at
all! Is it trit? I don't think we would need 3^256 addressing for a long
time.

Frank

foxidrive

unread,
Mar 21, 2012, 10:57:17 AM3/21/12
to
Beware the coming of the great white handkerchief!



--
Mic

billious

unread,
Mar 21, 2012, 11:01:16 AM3/21/12
to
why 3^(2^8)

shouldn't that be 3^(3^9)?


Frank P. Westlake

unread,
Mar 21, 2012, 12:36:07 PM3/21/12
to
On 2012-03-21 07:57, foxidrive wrote:
> Beware the coming of the great white handkerchief!

You lost me with that. I don't get out much and I've seen very little
television since the late '70s.

Frank

Frank P. Westlake

unread,
Mar 21, 2012, 12:45:17 PM3/21/12
to
On 2012-03-21 08:01, billious wrote:
> Frank P. Westlake wrote:
>> ... I thought quantum computers used base 3 instead of
>> base 2, so they wouldn't be bits at all! Is it trit?
>> I don't think we would need 3^256 addressing for a
>> long time.

> why 3^(2^8)
>
> shouldn't that be 3^(3^9)?

That would be 1.50541641452209262431432980333987e+9391 by my
calculation. Can we do that? Even just 3^(3^4) would be more than what
we have now.

Frank

foxidrive

unread,
Mar 22, 2012, 1:53:02 AM3/22/12
to
You just missed it Frank, it came out in 1981

http://www.imdb.com/title/tt0081874/


--
Mic

Frank P. Westlake

unread,
Mar 22, 2012, 9:18:07 AM3/22/12
to
"The Hitch Hikers Guide to the Galaxy"

Missed the movie and the book. I'm surprised though that I've never
heard the phrase "the great white handkerchief"; usually I hear such
things and wonder for years what it means.

My apologies to the group for going off topic.

Frank

foxidrive

unread,
Mar 22, 2012, 9:28:06 AM3/22/12
to
There was the original BBC Radio Series, and that was followed by the episodes in video form.
In 2005 there was a remake of HHGTTG which starred different actors and had some embellishments.

You really should take some time and listen to the radio show for a small download, or watch the original BBC video series.

It is a Trilogy in 6 parts. That gives you some warning how mind bogglingly silly the show is... :)


> My apologies to the group for going off topic.

I doubt anyone will lodge a written complaint considering the lack of on topic posts over the last few years. Anyway, here's a batch file:

@echo off
echo Don't Panic!






--
Mic

Dr J R Stockton

unread,
Mar 22, 2012, 3:19:11 PM3/22/12
to
In alt.msdos.batch.nt message <jkcia2$h1s$1...@news.albasani.net>, Wed, 21
Mar 2012 05:41:38, Frank P. Westlake <frank.w...@gmail.net> posted:
Then you set the top 63 bits to zero.

The internal address generation of a processor would be 256 bits, like
the data. But the implementations would bring out only as many address
lines as are might be needed in the life of the hardware family design,
with a trap for "I want to set a bit for which I have no pin [in use]".

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)

Frank P. Westlake

unread,
Mar 23, 2012, 9:31:59 AM3/23/12
to
On 2012-03-22 12:19, Dr J R Stockton wrote:
> The internal address generation of a processor would be 256 bits, like
> the data.

Which causes me to wonder. Can you proffer a guess as to what quantity
of data has been generated since the first storage media was created?
This includes everything generated, not only data that saved or
otherwise cached by the computer. If we were to create a single storage
device which would contain everything every computer ever did, how many
bytes would it require?

Frank

Harry Vaderchi

unread,
Mar 23, 2012, 9:51:08 AM3/23/12
to
On Thu, 22 Mar 2012 05:53:02 -0000, foxidrive
<foxi...@gotcha.woohoo.invalid> wrote:

> On 22/03/2012 03:36, Frank P. Westlake wrote:
>> On 2012-03-21 07:57, foxidrive wrote:
>>> Beware the coming of the great white handkerchief!
>>
Arklesneizure
>> You lost me with that. I don't get out much and I've seen very little
>> television since the late '70s.
>>
>> Frank
>
> You just missed it Frank, it came out in 1981
>
> http://www.imdb.com/title/tt0081874/
>
This one
http://www.imdb.com/title/tt0371724/
was 2005 and was on't telly the other night.


--
[dash dash space newline 4line sig]

Albi CNU

Tom Del Rosso

unread,
Mar 23, 2012, 12:38:55 PM3/23/12
to
To get a complete picture of what it did, you would have to save not only
the states of the registers but some record of the operation performed, like
saving all the opcodes executed.

Since the number of computers has increased with their speed, I think you
could just ignore everything before 1980, and maybe 1990, as insignificant.
The number of CPU's running at hundreds of MHz before 1980 was about equal
to the number in one branch of a bank in 1995.

I'd also like to see a graph of the number of transistors in the world over
time.

Frank P. Westlake

unread,
Mar 23, 2012, 1:04:57 PM3/23/12
to
On 2012-03-23 09:38, Tom Del Rosso wrote:
> Frank P. Westlake wrote:
>> If we were to create a single storage device which would contain
>> everything every computer ever did, how many bytes would it require?
>
> To get a complete picture of what it did, you would have to save not only
> the states of the registers but some record of the operation performed, like
> saving all the opcodes executed.

I guess that isn't what I was looking for. Perhaps it should be limited
to just what is saved and cached.

With this drive toward cloud computing (common storage) I can see that
the need for larger storage media will grow rapidly. Since the number of
people and computers and computer users are also growing rapidly I can
see that this common media will need to be larger than some people
expect. So my goal with the former question is just to get an idea of
how much data can accumulate in the time we've had so far that we could
have been accumulating, and then to project that with the exponential
growth we've been experiencing to see what kind of storage that
developers might be looking at in the future.

Frank

Tom Del Rosso

unread,
Mar 23, 2012, 3:51:22 PM3/23/12
to

Frank P. Westlake wrote:
> On 2012-03-23 09:38, Tom Del Rosso wrote:
> > Frank P. Westlake wrote:
> > > If we were to create a single storage device which would contain
> > > everything every computer ever did, how many bytes would it
> > > require?
> >
> > To get a complete picture of what it did, you would have to save
> > not only the states of the registers but some record of the
> > operation performed, like saving all the opcodes executed.
>
> I guess that isn't what I was looking for. Perhaps it should be
> limited to just what is saved and cached.

Well, saved and cached are very different things. What is cached can be
either more transient, or more frequently used, than what is saved.


> With this drive toward cloud computing (common storage) I can see that
> the need for larger storage media will grow rapidly. Since the number
> of people and computers and computer users are also growing rapidly I
> can see that this common media will need to be larger than some people
> expect. So my goal with the former question is just to get an idea of
> how much data can accumulate in the time we've had so far that we
> could have been accumulating, and then to project that with the
> exponential growth we've been experiencing to see what kind of
> storage that developers might be looking at in the future.

It would eliminate a lot of redundancy if everyone used shared storage.
Think of how an Exchange mail server uses 'single instance', so everyone who
sent or received an email uses the same copy.

On a somewhat related note, google has a downloadable white paper on hard
drive testing and fault prediction. They monitored thousands of drives at
google to collect data.

The bottom line was that drives show distinct signs half the time,
specifically reallocated sectors. The other half of all failures gave no
warning.

Frank P. Westlake

unread,
Mar 24, 2012, 9:15:57 AM3/24/12
to
On 2012-03-23 12:51, Tom Del Rosso wrote:
> It would eliminate a lot of redundancy if everyone used shared storage.
> Think of how an Exchange mail server uses 'single instance', so everyone who
> sent or received an email uses the same copy.

I don't want to persist this off-topic thread so hopefully my comments
here will finish the discussion.

I really have little knowledge of what the current technology is; my
research is mostly limited to what I need to get Java to behave in
compiler. But my thoughts are generally along these lines:

- It is more efficient to store data in ready access memory; normally
random access memory (RAM). Many of us here use or have used a RAM-drive
of some type.

- I used a Palm for a couple of years and my understanding is that
everything is installed into ready access memory and is always running;
although applications not being used are in a state of sleep.

- Non-volatile RAM is improving. When failures are negligible, and
when it is fast enough, and when it can be made large enough, we might
begin using it as both ready access memory and as primary storage.
External storage will be used mostly for backup. Like the Palm, when you
turn your computer off it goes into a battery-powered sleep.

- As we store more things in ready access memory we will need to make
it larger. So if this is the future then 128-bit architecture is not
unreasonable.

But the future is merely an indefinite imagination, the past a faulty
memory, and the present a point in time that never exists.

Frank
0 new messages