DOS command names on non-English Windows

Everything else that doesn't fall into one of the other PB categories.
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

DOS command names on non-English Windows

Post by MachineCode »

One of my apps calls the "ping" DOS command at the user's request, and I was wondering what happens if a non-English Windows PC tried to call it? Is it still called "ping" on a French install of Windows, and so on? Thanks.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: DOS command names on non-English Windows

Post by c4s »

"ping" is "pong" on Chinese Windows systems!
Just a joke. :lol: It has the same names on other installations as it's just the filename of the executable (see System32 folder)...
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: DOS command names on non-English Windows

Post by MachineCode »

Thanks for confirming... I wasn't sure if different installs of Windows had different filenames in System32.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6175
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: DOS command names on non-English Windows

Post by blueznl »

...but note that replies MAY differ from version to version and locale to locale.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: DOS command names on non-English Windows

Post by MachineCode »

Yeah, I always ensure that I don't use any English words from the output. On that subject, I assume "ms" (for milliseconds) is the same in every language? Like, "ping" would say "#ms" in its output on any language PC?
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Zach
Addict
Addict
Posts: 1678
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: DOS command names on non-English Windows

Post by Zach »

Measures should be reported the same I would think?

International standards and all.

Kind of like how a plus sign + means the same thing in math no matter what language you speak
User avatar
em_uk
Enthusiast
Enthusiast
Posts: 366
Joined: Sun Aug 08, 2010 3:32 pm
Location: Manchester UK

Re: DOS command names on non-English Windows

Post by em_uk »

Why not use COMatePLUS and do the the ping almost internally?

Code: Select all

IncludePath "C:\Program Files (x86)\PureBasic\"
XIncludeFile "COMatePLUS.pbi"

Procedure.s Ping_Status_Code(pingcode.i)

  Select pingcode
 
    Case 0
      Ping_Stat$ = "Success"
    Case 11001
      Ping_Stat$ = "Buffer Too Small"
    Case 11002
      Ping_Stat$ = "Destination Net Unreachable"
    Case 11003
      Ping_Stat$ = "Destination Host Unreachable"
    Case 11004
      Ping_Stat$ = "Destination Protocol Unreachable"
    Case 11005
      Ping_Stat$ = "Destination Port Unreachable"
    Case 11006
      Ping_Stat$ = "No Resources"
    Case 11007
      Ping_Stat$ = "Bad Option"
    Case 11008
      Ping_Stat$ = "Hardware Error"
    Case 11009
      Ping_Stat$ = "Packet Too Big"
    Case 11010
      Ping_Stat$ = "Request Timed Out"
    Case 11011
      Ping_Stat$ = "Bad Request"
    Case 11012
      Ping_Stat$ = "Bad Route"
    Case 11013
      Ping_Stat$ = "TimeToLive Expired Transit"
    Case 11014
      Ping_Stat$ = "TimeToLive Expired Reassembly"
    Case 11015
      Ping_Stat$ = "Parameter Problem"
    Case 11016
      Ping_Stat$ = "Source Quench"
    Case 11017
      Ping_Stat$ = "Option Too Big"
    Case 11018
      Ping_Stat$ = "Bad Destination"
    Case 11032
      Ping_Stat$ = "Negotiating IPSEC"
    Case 11050
      Ping_Stat$ = "General Failure"
    Default
      Ping_Stat$ = "Unknown"
 
  EndSelect

ProcedureReturn Ping_Stat$

EndProcedure

Procedure.s PING_Info(ping_address.s)
  Define.COMateObject objWMIService, PINGInfo
  sysPINGInfo.COMateEnumObject
  strComputer.s = "."
  strTarget$ = ping_address
  objWMIService = COMate_GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")
  If objWMIService
    sysPINGInfo = objWMIService\CreateEnumeration("ExecQuery('Select * from Win32_PingStatus Where Address= $0027" + strTarget$ +"$0027')") 
    If sysPINGInfo
      PINGInfo = sysPINGInfo\GetNextObject()
     
      While PINGInfo
       
        PING_StatusCode$ = Ping_Status_Code(PINGInfo\GetIntegerProperty("StatusCode"))
        PING_ProtocolAddress$ = PINGInfo\GetStringProperty("ProtocolAddress")
        PING_ResponseTime$ = Str(PINGInfo\GetIntegerProperty("ResponseTime"))
        PING_ResponseTimeToLive$ = Str(PINGInfo\GetIntegerProperty("ResponseTimeToLive"))
        PING_Get_Info$ = "Ping Status:   " + PING_StatusCode$ + "   Protocol Address:   " + PING_ProtocolAddress$ + "   Response Time (ms):  " + PING_ResponseTime$ + "   Response Time To Live (ms):  " + PING_ResponseTimeToLive$
                     
        PINGInfo\Release()
        PINGInfo = sysPINGInfo\GetNextObject()
      Wend
      sysPINGInfo\Release()
       
    EndIf
    objWMIService\Release()
    Else
      MessageRequester("Error", "PINGInfoInfo") 
  EndIf
  ProcedureReturn PING_Get_Info$
EndProcedure

Debug PING_Info("www.google.com")
----

R Tape loading error, 0:1
User avatar
Shardik
Addict
Addict
Posts: 2079
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: DOS command names on non-English Windows

Post by Shardik »

em_uk,

it would be nice if you would have given credit to the original poster
of your code by mentioning his name and posting the link:
SFSxOI
http://purebasic.fr/english/viewtopic.php?t=36390
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6175
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: DOS command names on non-English Windows

Post by blueznl »

No, replies CAN differ depending on locale and version. But, frankly, come to think of it, I dunno' if that still holds true. It was true 'in the old days' (but then again I started out with a slab of stone and a chisel, and a [backspace] was hard work and [del] was still an infernal concept)...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: DOS command names on non-English Windows

Post by MachineCode »

em_uk wrote:Why not use COMatePLUS and do the the ping almost internally?
I could, but it adds bloat to my app just to do a "ping" (it adds 53 KB to my exe size; no thanks!). Besides, I wasn't really being specific to "ping", but more about the subject of this thread in general.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Thorium
Addict
Addict
Posts: 1314
Joined: Sat Aug 15, 2009 6:59 pm

Re: DOS command names on non-English Windows

Post by Thorium »

Zach wrote: International standards and all.
Kind of like how a plus sign + means the same thing in math no matter what language you speak
Not every country has the same standards, not even for math. One example is how to express floating point numbers. In US you use the point "." to separate the integer part and the fraction part. In germany we use comma and we even call it Fließkommanummer, which is translated: floating comma number.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: DOS command names on non-English Windows

Post by c4s »

Thorium wrote:In germany we use comma and we even call it Fließkommanummer, which is translated: floating comma number.
Fließkommazahl. :wink:

There is also the metric vs. non-metric system and whatnot.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: DOS command names on non-English Windows

Post by Danilo »

c4s wrote:There is also the metric vs. non-metric system and whatnot.
Yeah. Why did this outsiders that left Europe 500 years ago for going to the "new land"
not take European measure units with them?
Zach
Addict
Addict
Posts: 1678
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: DOS command names on non-English Windows

Post by Zach »

The Metric system was not devised until 1790, and not officially established until 1800. It is only 211 years old, not even as old as the United States.
Britain didn't adopt Metric until 1975, but you can still find old measurements still in use.

We actually do use the metric system a fair deal in the USA, but the problem with switching outright is all the math involved, and having to convert back and forth. This would be a problem for any large society.

Plus the manufacturer base is starting to skip Metric, and adopt the Decimal Inch because it is more accurate where high accuracy is needed.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: DOS command names on non-English Windows

Post by Danilo »

Zach wrote:The Metric system was not devised until 1790, and not officially established until 1800. It is only 211 years old, not even as old as the United States.
Ahh, OK, thx. I just wondered because i had seen a documentary that showed first
human relatives to be 7.5 million years old and the first humans in Europe like 6 million years old
and i just remembered that the humans that left Europe 500 years ago were mostly crazy sect members
that were not wanted in Europe. Our world is so confusing... ;)

btw: i live in Ingolstadt/Germany, the town where Adam Weishaupt (a.k.a. George Washington, the 1st president of the U.S.of America)
founded the Illuminati order. :D
Post Reply