mIRC Home    About    Download    Register    News    Help

Print Thread
#139375 13/01/06 07:59 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I had gotten off of these boards a little alias that could ping via command.com in win98
Code:
wping {
 run command.com /c ping $1 > c:\mirc\trace\ping.txt  
 .timer4p 1 20 loadbuf -s c:\mirc\trace\ping.txt
}


Any way to do the same thing in XP?

#139376 13/01/06 08:26 PM
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Just change command.com to cmd.exe and it should work.

Edit: It seems to work fine even without the change.

#139377 13/01/06 09:23 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Hmm, if I use the alias I get a help file on setting variables
the start is

C:\mirc61>echo off
Displays, sets, or removes cmd.exe environment variables.

yet if I input the same line via start-run it works right.
this is the same for either command.com or cmd.exe (though command.com comes back with much less text)

#139378 13/01/06 10:02 PM
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Well, I couldn't get it to work completely using the original code you posted.

I changed it to this, and it worked fine.

Code:
alias wping {
  run command.com /c ping $1 > ping.txt  
  .timer4p 1 5 loadbuf -s ping.txt
}

#139379 13/01/06 11:18 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
I have no idea why, but neither version, or any of the things I have tried have worked, so its my system thats buggy some how.
Thanks anyway.

#139380 14/01/06 12:34 AM
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
By the way, it doesn't seem to make a difference whether I use command.com or cmd.exe. It displays the same amount of text either way.

#139381 14/01/06 02:18 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The only time you would notice a difference between using command.com and cmd.exe, is if you were using a system running Windows 98SE (or lower)

cmd.exe was added to the Windows opearating system as of Windows ME (I believe. I don't have a copy of ME running to test that)

Usage of command.com was maintained for compatability purposes.

#139382 14/01/06 03:16 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Actually cmd.exe is the NT command line interpreter, a program that functions under the NT OS, it existed before ME (which isnt NT anyway) and I would assume if ME has it its a cludge program to make ME appear/function like an upgrade of 2000 (which it wasnt).

#139383 14/01/06 10:06 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Try Online's Extension to /run

//xrun -wh $+(%,comspec%) /c ping www.google.com> $mircdirgoogle.txt | loadbuf -s google.txt

%comspec% is an environment variable that will evaluate to the path of the command executable, therefore it doesn't matter which OS someone is using.

The h flag keeps the program hidden, using the w flag makes the code wait with executing the following command until the program is done.

This snippet takes advantage of the Windows Script Host (WSH) Run method


Gone.
#139384 14/01/06 12:51 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
By the way you don't need the cmd.exe in order to use ping.

Running ping.exe will be fine.


Gone.
#139385 14/01/06 10:14 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
since nothing I tried worked, I dug deaper, at some point I tried writing a bat file "ping.bat" when running the script then it did not go to ping.exe in windows, rather ping.bat in mIRC's folder. I kept seeing that it had the mirc path in the "dos" window and it finally clicked to look for bat files.
after renaming the bat file the alias works but any IP other than 127.0.0.1 times out (pulling hair). Yes I turned off all firewalls.

#139386 14/01/06 10:30 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Quote:
Try Online's Extension to /run

//xrun -wh $+(%,comspec%) /c ping www.google.com> $mircdirgoogle.txt | loadbuf -s google.txt


I downloaded that and the original alias and the one you have here all "time out" from packet loss (dialup)
Quote:

* Dns resolving forums.mirc.com
-
forums.mirc.com
resolved to 130.89.175.22
130.89.175.22 resolved to forums.mirc.com
is on No channels I am on
-
* Dns resolved forums.mirc.com to 130.89.175.22
-

Pinging 130.89.175.22 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 130.89.175.22:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

#139387 15/01/06 07:59 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
I can't really help you further anymore, sounds like something is happening with your ping.exe, not related to mIRC.


Gone.
#139388 15/01/06 08:08 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
OP Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Thanks FiberOPtics
I think its related to my ISP to be honest as I have tested on a laptop that is new running xp home and a PC running XP pro and I have 100% packet loss to _most_ IPs, yet I can ping on mIRC just fine. (I do understand mIRC (IRC) pings are over the server and are not the same)

#139389 16/01/06 05:44 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
your router is likely blocking the ping replies


Link Copied to Clipboard