playlet Posted September 6, 2010 Author Posted September 6, 2010 (edited) --- Edited August 18, 2016 by playlet
lee321987 Posted September 7, 2010 Posted September 7, 2010 Do you have "Local Area Connection" in Network Connections? It only works with the exact title: "Local Area Connection". Yes, that is what it's called. I tried to fix it myself. I inserted a line into 'Func LAN_Check' (last line is mine): Func LAN_Check($oLanConnection = "Local Area Connection", $strFolderName = "Network Connections") $ShellApp = ObjCreate("Shell.Application") $oControlPanel = $ShellApp.Namespace(3) $oNetConnections = "" For $FolderItem In $oControlPanel.Items $var &= @CRLF & $FolderItem.Name After that For loop, here is the contents of $var: expandcollapse popupPower Options Notification Area Icons Taskbar and Start Menu Credential Manager Default Programs RemoteApp and Desktop Connections Windows Update Desktop Gadgets Windows Firewall Phone and Modem Java Speech Recognition User Accounts Region and Language HomeGroup Mouse Folder Options Keyboard Device Manager Windows CardSpace Performance Information and Tools Programs and Features Indexing Options Network and Sharing Center Parental Controls AutoPlay Sync Center Recovery Internet Options Devices and Printers Color Management Backup and Restore System Action Center Fonts Display Troubleshooting Getting Started Administrative Tools Ease of Access Center Windows Defender IFS Drives Control Panel Item BitLocker Drive Encryption Date and Time Location and Other Sensors Personalization Sound Realtek HD Audio Manager Directory Opus Prefs Directory Opus Customize QuickTime (32-bit) Since there is no "Network Connections" in the list I changed the first line of Func LAN_Check to: Func LAN_Check($oLanConnection = "Local Area Connection", $strFolderName = "Network and Sharing Center"). Still get the error, and $oNetConnections.Items.Count after that For loop returns "0" (zero). I only have small experience with ObjCreate (have a little experience with Visual Basic .NET from a couple years ago).
playlet Posted September 7, 2010 Author Posted September 7, 2010 (edited) --- Edited August 18, 2016 by playlet
playlet Posted October 25, 2010 Author Posted October 25, 2010 (edited) --- Edited August 18, 2016 by playlet
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