'**************************************************************** ' File: ShowMyShares.vbs (WSH for VBscript) ' Author: (c) M. Gallant 10/04/2000 ' ' Displays Windows Shared Network Resources ' Win95/98: Launches C:\windows\netwatch.exe if installed. ' WinNT/2000: Runs "net share" system command in DOS window. ' '**************************************************************** Option Explicit Dim WshShell, fso, WshEnvir, netwatch, netshare, environ set WshShell = WScript.CreateObject("WScript.Shell") set fso = WScript.CreateObject("Scripting.FileSystemObject") set WshEnvir = WshShell.Environment("Process") netwatch = "C:\Windows\netwatch.exe" netshare = "%comspec% /K net share" If WshEnvir("OS") = "Windows_NT" Then WshShell.Run netshare ElseIf fso.FileExists(netwatch) Then WshShell.Run netwatch Else WScript.Echo "File " & netwatch & " not found." WScript.Quit End If '------------------ End Script -----------------------------------