friends Posted June 23, 2005 Share Posted June 23, 2005 Hi all. I don't remember who actually wrote this script. However.... I loved it very much and find it very useful for me to implement it with my script. It works fine with WinXP, but not Windows 2000 (SP4). I wonder if someone can fix it.... so that it works well in Win2000. Thanks for the help. Here's the coding.... (Credit: Thanks to the script writer) ; 1 means alive ; 0 means disconnect WHILE 1 ;DLLOpen ("SENSAPI.dll") $x = DLLCall ("SENSAPI1.dll","int","IsNetworkAlive") msgbox (4096,"TEST",$x[0], 3) IF $x[0] = 0 THEN MsgBox (0, "", "Kindly contact MIS !", 3) ELSE MsgBox (0, "", "Network is alive !", 3) ENDIF ;DLLClose ("SENSAPI.dll") WEND Link to comment Share on other sites More sharing options...
ning Posted June 23, 2005 Share Posted June 23, 2005 Works for me (Windows 2000 SP3). I changed "SENSAPI1.DLL" to "SENSAPI.DLL" in the DLLCall. Maybe that was the problem - you've incorrectly referenced the DLL? cheers ben Link to comment Share on other sites More sharing options...
friends Posted June 24, 2005 Author Share Posted June 24, 2005 Works for me (Windows 2000 SP3). I changed "SENSAPI1.DLL" to "SENSAPI.DLL" in the DLLCall. Maybe that was the problem - you've incorrectly referenced the DLL?cheersben<{POST_SNAPBACK}>Oh yaa.... thanks for the notification.How careless I am.... I didn't notice that there is "1" at the backof the DLL file.... :"> thanks dude.... I think it should work now ! Link to comment Share on other sites More sharing options...
friends Posted June 28, 2005 Author Share Posted June 28, 2005 Oh yaa.... thanks for the notification.How careless I am.... I didn't notice that there is "1" at the backof the DLL file.... :"> thanks dude.... I think it should work now !<{POST_SNAPBACK}>I've tested it out on Win2000 SP4, it really does not work !kindly see the attached file.....anybody knows how to fix this ?Thanks Link to comment Share on other sites More sharing options...
/dev/null Posted June 28, 2005 Share Posted June 28, 2005 I've tested it out on Win2000 SP4, it really does not work !kindly see the attached file.....anybody knows how to fix this ?Thanks<{POST_SNAPBACK}>$x = DLLCall ("SENSAPI1.dll","int","IsNetworkAlive")acccording to MSDN, IsNetworkAlive needs a parameter. MSDN Link, so use this (untested):const $NETWORK_ALIVE_LAN 0x00000001 const $NETWORK_ALIVE_WAN 0x00000002 const $NETWORK_ALIVE_AOL 0x00000004 $flags = $NETWORK_ALIVE_LAN $x = DLLCall ("SENSAPI1.dll","int","IsNetworkAlive","long", $flags)CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
friends Posted June 28, 2005 Author Share Posted June 28, 2005 $x = DLLCall ("SENSAPI1.dll","int","IsNetworkAlive")acccording to MSDN, IsNetworkAlive needs a parameter. MSDN Link, so use this (untested):const $NETWORK_ALIVE_LAN 0x00000001 const $NETWORK_ALIVE_WAN 0x00000002 const $NETWORK_ALIVE_AOL 0x00000004 $flags = $NETWORK_ALIVE_LAN $x = DLLCall ("SENSAPI1.dll","int","IsNetworkAlive","long", $flags)CheersKurt<{POST_SNAPBACK}>Sorry... the code given does not work.I'm not familiar with the DLLCALL stuffs yet.... I hope someonecould give me a working example for this.Please see the error message. Thank you. Link to comment Share on other sites More sharing options...
JSThePatriot Posted June 28, 2005 Share Posted June 28, 2005 What that means is do this to the code... add an equal sign (=). const $NETWORK_ALIVE_LAN = 0x00000001 const $NETWORK_ALIVE_WAN = 0x00000002 const $NETWORK_ALIVE_AOL = 0x00000004 $flags = $NETWORK_ALIVE_LAN $x = DLLCall ("SENSAPI1.dll","int","IsNetworkAlive","long", $flags) Try to learn. Dont just ask for someone to use their time for your cause. I cant believe you didnt get that error. Had absolutely nothing to do with the DLLCall() function. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
friends Posted July 24, 2005 Author Share Posted July 24, 2005 Can someone please help me up with the network detection for Windows 2000 SP4 ? I had tried out the script given, it didn't work out. I need this to detect if the network is established or not. Hope someone will help me up with this. Thanks in advance Link to comment Share on other sites More sharing options...
Wus Posted July 24, 2005 Share Posted July 24, 2005 If I recall this can be done with WMI.I forget where but search the forums or find it on http://msdn.microsoft.com/library/default....i_reference.aspyou may also be able make your own UDF to accomplish what you wantsomething without com or dllcallssomthing likeIf @ipaddress1 <> "0.0.0.0" AND @ipaddress1 <> "127.0.0.1" Then MsgBox( 48, "Network Status", "Network Connection Up") Else MsgBox( 48, "Network Status", "Network Connection Down") EndIfI havent tested that but I cant think why it shouldnt work.But you learning how to do WMI or DLLcalls and writing your own script would be a better answer. Link to comment Share on other sites More sharing options...
jdickens Posted July 25, 2005 Share Posted July 25, 2005 What resource are you trying to reach on the network? If you test for that, maybe I can help. There have been multiple threads on detecting accessibility of a network drive. J If I am too verbose, just say so. You don't need to run on and on. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now