From: dave on 26 Nov 2009 10:48 hi guys/gals, i am very new to batch scripting and was wondering how would i go about creating a batch file to display a pc ip address and a message when the mouse rolls over the clock area of the task bar? thanks in advance
From: Richard Mueller [MVP] on 26 Nov 2009 13:03 "dave" <dave(a)discussions.microsoft.com> wrote in message news:BCE44647-7F3F-4260-AC66-659AD1279EA2(a)microsoft.com... > hi guys/gals, > > i am very new to batch scripting and was wondering how would i go about > creating a batch file to display a pc ip address and a message when the > mouse > rolls over the clock area of the task bar? > > thanks in advance Batch files and VBScript programs cannot detect mouse rollover events. VB programs can, but only on forms belonging to the program. You would need to code your own clock application to achieve this functionality. You could code a VBScript program to retrieve the current IP address, then place a shortcut on the desktop that runs the program. For example, the following VBScript could be used (assuming the client is XP or above, or has WSH 5.6 installed): ========= Option Explicit Dim strComputer, objShell, intPings, intTO Dim strResults, objExecObject, intStart, intEnd, strIP ' NetBIOS name of computer. strComputer = "Idaho" ' Number of pings. intPings = 1 ' Timeout in milliseconds. intTO = 2000 Set objShell = CreateObject("Wscript.Shell") ' Ping the machine. Set objExecObject = objShell.Exec("%comspec% /c ping -n " _ & CStr(intPings) & " -w " & CStr(intTO) & " " & strComputer) ' Read the output. Do Until objExecObject.StdOut.AtEndOfStream strResults = objExecObject.StdOut.ReadAll Loop intStart = InStr(strResults, "[") + 1 intEnd = InStr(strResults, "]") strIP = Mid(strResults, intStart, intEnd - intStart - 0) Call MsgBox(strIP) -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net --
From: dave on 26 Nov 2009 16:25 thanks richard for the quick response. In that case is there some sort of script that could, for instance display the username of a user logged into a pc and their IP address in the start menu of windows? "Richard Mueller [MVP]" wrote: > > "dave" <dave(a)discussions.microsoft.com> wrote in message > news:BCE44647-7F3F-4260-AC66-659AD1279EA2(a)microsoft.com... > > hi guys/gals, > > > > i am very new to batch scripting and was wondering how would i go about > > creating a batch file to display a pc ip address and a message when the > > mouse > > rolls over the clock area of the task bar? > > > > thanks in advance > > Batch files and VBScript programs cannot detect mouse rollover events. VB > programs can, but only on forms belonging to the program. You would need to > code your own clock application to achieve this functionality. > > You could code a VBScript program to retrieve the current IP address, then > place a shortcut on the desktop that runs the program. For example, the > following VBScript could be used (assuming the client is XP or above, or has > WSH 5.6 installed): > ========= > Option Explicit > > Dim strComputer, objShell, intPings, intTO > Dim strResults, objExecObject, intStart, intEnd, strIP > > ' NetBIOS name of computer. > strComputer = "Idaho" > > ' Number of pings. > intPings = 1 > > ' Timeout in milliseconds. > intTO = 2000 > > Set objShell = CreateObject("Wscript.Shell") > > ' Ping the machine. > Set objExecObject = objShell.Exec("%comspec% /c ping -n " _ > & CStr(intPings) & " -w " & CStr(intTO) & " " & strComputer) > > ' Read the output. > Do Until objExecObject.StdOut.AtEndOfStream > strResults = objExecObject.StdOut.ReadAll > Loop > > intStart = InStr(strResults, "[") + 1 > intEnd = InStr(strResults, "]") > strIP = Mid(strResults, intStart, intEnd - intStart - 0) > Call MsgBox(strIP) > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > > . >
From: dave on 29 Nov 2009 15:21 Any help with this would be greatly appreciated "dave" wrote: > thanks richard for the quick response. In that case is there some sort of > script that could, for instance display the username of a user logged into a > pc and their IP address in the start menu of windows? > > "Richard Mueller [MVP]" wrote: > > > > > "dave" <dave(a)discussions.microsoft.com> wrote in message > > news:BCE44647-7F3F-4260-AC66-659AD1279EA2(a)microsoft.com... > > > hi guys/gals, > > > > > > i am very new to batch scripting and was wondering how would i go about > > > creating a batch file to display a pc ip address and a message when the > > > mouse > > > rolls over the clock area of the task bar? > > > > > > thanks in advance > > > > Batch files and VBScript programs cannot detect mouse rollover events. VB > > programs can, but only on forms belonging to the program. You would need to > > code your own clock application to achieve this functionality. > > > > You could code a VBScript program to retrieve the current IP address, then > > place a shortcut on the desktop that runs the program. For example, the > > following VBScript could be used (assuming the client is XP or above, or has > > WSH 5.6 installed): > > ========= > > Option Explicit > > > > Dim strComputer, objShell, intPings, intTO > > Dim strResults, objExecObject, intStart, intEnd, strIP > > > > ' NetBIOS name of computer. > > strComputer = "Idaho" > > > > ' Number of pings. > > intPings = 1 > > > > ' Timeout in milliseconds. > > intTO = 2000 > > > > Set objShell = CreateObject("Wscript.Shell") > > > > ' Ping the machine. > > Set objExecObject = objShell.Exec("%comspec% /c ping -n " _ > > & CStr(intPings) & " -w " & CStr(intTO) & " " & strComputer) > > > > ' Read the output. > > Do Until objExecObject.StdOut.AtEndOfStream > > strResults = objExecObject.StdOut.ReadAll > > Loop > > > > intStart = InStr(strResults, "[") + 1 > > intEnd = InStr(strResults, "]") > > strIP = Mid(strResults, intStart, intEnd - intStart - 0) > > Call MsgBox(strIP) > > > > -- > > Richard Mueller > > MVP Directory Services > > Hilltop Lab - http://www.rlmueller.net > > -- > > > > > > . > >
|
Pages: 1 Prev: Application.OnTime Not Working Next: Posting NNTP message with script. |