Page 1 of 1 1
Topic Options
#178427 - 2007-07-25 11:51 PM WKIX32 and Ping and very stuck !
Whistler Offline
Lurker

Registered: 2007-07-25
Posts: 1
Hi,

I am new to kix scripting and have been looking at the various codes on both here and on kixforms.

To run the scripts I drag them over the Wkix32.exe using windows explorer.

I have copied some code from the examples and as a standalone script it works. The ping command runs and the dos box closes.
 Code:
shell "%comspec% /e:1024 /c ping 192.168.2.1" 


I then went on to create a very basic form with a single button and a picture, the button then calls the above code inside a function.
 Code:
 Function Button

shell "%comspec% /e:1024 /c ping 192.168.2.1"
EndFunction


When the button is pressed it runs the code, but the Dos window stays open and unless I close the form I cant get it to close.

I cant seem to find a way that once i get the 3 responses from the Ping or the final results are displayed that I can get the dos box to close.

Any help is much appreciated.

TIA

Top
#178429 - 2007-07-26 12:32 AM Re: WKIX32 and Ping and very stuck ! [Re: Whistler]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
You can see my version of it at http://www.kixforms.org/forum/viewtopic.php?t=810
Maybe more that you are looking for, but it worked for me.

This was my shell command
 Code:
Shell 'CMD.EXE /c PING '+$Element+' -n 2 | find /i "TTL" >nul' 


Where $Element was the server/device I wanted to ping
_________________________
Today is the tomorrow you worried about yesterday.

Top
#178432 - 2007-07-26 01:54 AM Re: WKIX32 and Ping and very stuck ! [Re: Gargoyle]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
loose the dos box and use wmiPing() from our udf forum.
_________________________
!

download KiXnet

Top
#178434 - 2007-07-26 02:29 AM Re: WKIX32 and Ping and very stuck ! [Re: Lonkero]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
not positive without looking but don't think wmiPing will work on 2000 boxes.
Top
#178438 - 2007-07-26 09:11 AM Re: WKIX32 and Ping and very stuck ! [Re: NTDOC]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
The Ping() UDF would also be an option.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#178439 - 2007-07-26 09:28 AM Re: WKIX32 and Ping and very stuck ! [Re: Gargoyle]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
I get never tired to mention that "TTL=" is the thing to search for to get 100% correct staements about a reply... You may search the board for "TTL=" to get an explanation
_________________________



Top
#178442 - 2007-07-26 09:41 AM Re: WKIX32 and Ping and very stuck ! [Re: Jochen]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
 Originally Posted By: Jochen
I get never tired to mention


LOL - So I can post and ask you each day

Top
#178443 - 2007-07-26 09:47 AM Re: WKIX32 and Ping and very stuck ! [Re: NTDOC]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
_________________________



Top
#178444 - 2007-07-26 02:23 PM Re: WKIX32 and Ping and very stuck ! [Re: Jochen]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
 Originally Posted By: Jochen
I get never tired to mention that "TTL=" is the thing to search for to get 100% correct staements about a reply


I would not be surprised that is why I have it in there.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#178445 - 2007-07-26 02:31 PM Re: WKIX32 and Ping and very stuck ! [Re: Gargoyle]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
You only have "TTL" ... this would give a false result on "TTL expired in transit"
_________________________



Top
#178499 - 2007-07-27 02:01 AM Re: WKIX32 and Ping and very stuck ! [Re: NTDOC]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
why wouldn't wmiping() work for 2000+ computers???
_________________________
!

download KiXnet

Top
#178502 - 2007-07-27 04:03 AM Re: WKIX32 and Ping and very stuck ! [Re: Lonkero]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Like said, have not looked at the code but if it's using the WMI code I think it is that method is new to XP
Top
#178504 - 2007-07-27 04:49 AM Re: WKIX32 and Ping and very stuck ! [Re: NTDOC]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The WMIOPing() UDF header says so
 Code:
; DEPENDENCIES:
;   Windows XP or Server 2003

And the reason is that the ability to use a ping via WMI was only introduced in Windows XP/2003 and never retro-fitted to the older operating systems.
_________________________
There are two types of vessels, submarines and targets.

Top
#178511 - 2007-07-27 10:36 AM Re: WKIX32 and Ping and very stuck ! [Re: Sealeopard]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
oh? WMI exists for nt4 and 2k - not built into it tho.
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#178523 - 2007-07-27 08:09 PM Re: WKIX32 and Ping and very stuck ! [Re: Björn]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Yes it is built-in to Windows 2000 as well but each new version of Windows OS adds support for new items in WMI - There are now items that Vista has that XP does not have and I'm sure Server 2008 will have some that Vista does not have, etc...
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 302 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.146 seconds in which 0.101 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org