I use VNC and have to walk users through cmd > ipconfig to get there IP address. Is there a batch file I could place on their desktops to simply click and display the address. Thanks.
Sure, Just paste this into a text file and name it something.vbs. strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set IPConfigSet = objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE") For Each IPConfig in IPConfigSet If Not IsNull(IPConfig.IPAddress) Then For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress) WScript.Echo IPConfig.IPAddress(i) Next End If Next "Bobby" wrote: > I use VNC and have to walk users through cmd > ipconfig to get there IP > address. Is there a batch file I could place on their desktops to simply > click and display the address. > > Thanks. > > >
That's nice. Thanks. (Wish I knew scripting) "bxr222" wrote in message news:A2184B59-7D3D-4F74-9B56-30ED98B68F13@microsoft.com... > Sure, > Just paste this into a text file and name it something.vbs. > > strComputer = "." > Set objWMIService = GetObject("winmgmts:" _ > & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") > > Set IPConfigSet = objWMIService.ExecQuery _ > ("Select * from Win32_NetworkAdapterConfiguration Where > IPEnabled=TRUE") > > For Each IPConfig in IPConfigSet > If Not IsNull(IPConfig.IPAddress) Then > For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress) > WScript.Echo IPConfig.IPAddress(i) > Next > End If > Next > > > > "Bobby" wrote: > >> I use VNC and have to walk users through cmd > ipconfig to get there IP >> address. Is there a batch file I could place on their desktops to simply >> click and display the address. >> >> Thanks. >> >> >>
Here's a variation that may be even easier... create a shortcut on desktop with the target: cmd /k ipconfig Get creative and create a login script that will create this shortcut on each user's desktop, something like this: dim winshell dim shortcut dim winnet set winnet = createobject("Wscript.Network") set winshell = createobject("Wscript.Shell") set shortcut = winshell.createshortcut("C:\documents and settings\" & winnet.username & "\desktop\name of shortcut.lnk") shortcut.targetpath = "cmd /k ipconfig" shortcut.save wscript.quit "Bobby" wrote in message news:uynAlHdmFHA.3120@TK2MSFTNGP09.phx.gbl... > That's nice. Thanks. (Wish I knew scripting) > > > "bxr222" wrote in message > news:A2184B59-7D3D-4F74-9B56-30ED98B68F13@microsoft.com... > > Sure, > > Just paste this into a text file and name it something.vbs. > > > > strComputer = "." > > Set objWMIService = GetObject("winmgmts:" _ > > & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") > > > > Set IPConfigSet = objWMIService.ExecQuery _ > > ("Select * from Win32_NetworkAdapterConfiguration Where > > IPEnabled=TRUE") > > > > For Each IPConfig in IPConfigSet > > If Not IsNull(IPConfig.IPAddress) Then > > For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress) > > WScript.Echo IPConfig.IPAddress(i) > > Next > > End If > > Next > > > > > > > > "Bobby" wrote: > > > >> I use VNC and have to walk users through cmd > ipconfig to get there IP > >> address. Is there a batch file I could place on their desktops to simply > >> click and display the address. > >> > >> Thanks. > >> > >> > >> > >
Hello, This is really cooolll... Can ANYONE suggest some books on VBScript??? "Steve Wolfie" <stevewolfie@community.nospam> wrote in message news:uxxSEygmFHA.3336@tk2msftngp13.phx.gbl... > Here's a variation that may be even easier... > > create a shortcut on desktop with the target: > > cmd /k ipconfig > > > > Get creative and create a login script that will create this shortcut on > each user's desktop, something like this: > > dim winshell > dim shortcut > dim winnet > > set winnet = createobject("Wscript.Network") > set winshell = createobject("Wscript.Shell") > set shortcut = winshell.createshortcut("C:\documents and settings\" & > winnet.username & "\desktop\name of shortcut.lnk") > > shortcut.targetpath = "cmd /k ipconfig" > shortcut.save > > wscript.quit > > > "Bobby" wrote in message > news:uynAlHdmFHA.3120@TK2MSFTNGP09.phx.gbl... > > That's nice. Thanks. (Wish I knew scripting) > > > > > > "bxr222" wrote in message > > news:A2184B59-7D3D-4F74-9B56-30ED98B68F13@microsoft.com... > > > Sure, > > > Just paste this into a text file and name it something.vbs. > > > > > > strComputer = "." > > > Set objWMIService = GetObject("winmgmts:" _ > > > & "{impersonationLevel=impersonate}!\\" & strComputer & > "\root\cimv2") > > > > > > Set IPConfigSet = objWMIService.ExecQuery _ > > > ("Select * from Win32_NetworkAdapterConfiguration Where > > > IPEnabled=TRUE") > > > > > > For Each IPConfig in IPConfigSet > > > If Not IsNull(IPConfig.IPAddress) Then > > > For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress) > > > WScript.Echo IPConfig.IPAddress(i) > > > Next > > > End If > > > Next > > > > > > > > > > > > "Bobby" wrote: > > > > > >> I use VNC and have to walk users through cmd > ipconfig to get there IP > > >> address. Is there a batch file I could place on their desktops to > simply > > >> click and display the address. > > >> > > >> Thanks. > > >> > > >> > > >> > > > > > >
"Charles L. Phillips" wrote in message news:%231So4yumFHA.2152@TK2MSFTNGP14.phx.gbl... > Hello, > This is really cooolll... > Can ANYONE suggest some books on VBScript??? I am quite fond of this book: Managing Enterprise Systems with the Windows Script Host: http://amazon.com/exec/obidos/tg/detail/-/1893115674/
Steve Wolfie wrote: > Here's a variation that may be even easier... > > create a shortcut on desktop with the target: > > cmd /k ipconfig > > > Get creative and create a login script that will create this > shortcut on each user's desktop, something like this: > (snip) > set winnet = createobject("Wscript.Network") > set winshell = createobject("Wscript.Shell") > set shortcut = winshell.createshortcut("C:\documents and settings\" & > winnet.username & "\desktop\name of shortcut.lnk") > > shortcut.targetpath = "cmd /k ipconfig" > shortcut.save Hi, Never use username to get a user's profile path, because sometimes the user profile path contains more than just the username (e.g. <username>.<domain>, <username>.000, <username>.windows). Some alternatives: '--------------------8<---------------------- Set oShell = CreateObject("WScript.Shell") ' Display path to user's Desktop folder WScript.Echo oShell.SpecialFolders("Desktop") WScript.Echo oShell.ExpandEnvironmentStrings("%UserProfile%\Desktop") ' Display path to All Users Desktop folder WScript.Echo oShell.SpecialFolders("AllUsersDesktop") '--------------------8<---------------------- Also note that for your IP config shortcut script to work, you will need to use the .Arguments property of the CreateShortcut method. Try this one: '--------------------8<---------------------- Set oShell = CreateObject("WScript.Shell") ' Create shortcut in the Desktop folder sUserDesktopPath = oShell.SpecialFolders("Desktop") Set oShortCut = oShell.CreateShortcut( _ sUserDesktopPath & "\IP Config.lnk") oShortCut.TargetPath = "%comspec%" oShortCut.Arguments = "/k ipconfig.exe" oShortCut.Save '--------------------8<---------------------- -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter/default.mspx
Charles L. Phillips wrote: > Hello, > This is really cooolll... > Can ANYONE suggest some books on VBScript??? > Hi, For admin scripting with VBScript I would say Microsoft Windows 2000 Scripting Guide: http://www.microsoft.com/mspress/books/6417.asp http://www.amazon.com/exec/obidos/ASIN/0735618674/002-7141687-9862444 Here are some other WSH/VBScript starting points: Welcome to the Script Center http://www.microsoft.com/technet/scriptcenter/default.mspx The updated Portable Script Center (v3.0), the *.chm version of all of the sample scripts on the TechNet Script Center site... Download details: System Administration Scripting Guide Scripts http://www.microsoft.com/downloads/details.aspx?displaylang=en&familyid=b4cb2678-dafb-4e30-b2da-b8814fe2da5a For a list of some scripting resources and links to some Windows Script Host (WSH) Web introductions, take a look here: http://groups.google.co.uk/groups?selm=3FFC3C56.4C6A07C0@hydro.com -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter/default.mspx
You also might want to download a free program called bginfo.
Users cant' run the .vbs because they are only users/power users. "de Graff" wrote in message news:OZyMr7EnFHA.2180@TK2MSFTNGP15.phx.gbl... > You also might want to download a free program called bginfo. >
how to make ipconfig using script url:http://www.ureader.com/msg/16752076.aspx
Unless you actually prefer to use a primitive command window, you might want to try this: http://www.microsoft.com/downloads/details.aspx?familyid=00A974B4-0BFA-4065- 8081-BBAEBF2A5CB6&displaylang=en In Win9x there's a little applet called winipcfg. It's a Win32 program rather than a command line tool. The window shows info., Release button, Renew button, etc. The link above is the exact same thing for NT. I've used it on XP. I assume it also works on Vista/7. But for some reason MS doesn't ship it with NT systems.