Removed hostname checking and fixed crash if connect to image share fails.
This commit is contained in:
parent
fc2dcc8fae
commit
4c40b79a99
1 changed files with 99 additions and 99 deletions
|
@ -12,9 +12,6 @@ Dim sDrive, sVmrunPath
|
||||||
sDrive = "\\st-vmware\vmware"
|
sDrive = "\\st-vmware\vmware"
|
||||||
sVmrunPath = sDrive & "\bin\vmrun.vbs"
|
sVmrunPath = sDrive & "\bin\vmrun.vbs"
|
||||||
|
|
||||||
If LCase(Left(oNetwork.ComputerName, 9)) = "stupid-pc" Or _
|
|
||||||
LCase(oNetwork.ComputerName) = "ee-pc2" Then
|
|
||||||
|
|
||||||
' Determine vmware icon path and quit if not found (eg. vmware not installed)
|
' Determine vmware icon path and quit if not found (eg. vmware not installed)
|
||||||
Dim sIconPath
|
Dim sIconPath
|
||||||
On Error Resume Next
|
On Error Resume Next
|
||||||
|
@ -51,7 +48,12 @@ If LCase(Left(oNetwork.ComputerName, 9)) = "stupid-pc" Or _
|
||||||
|
|
||||||
' Find image files and loop through them
|
' Find image files and loop through them
|
||||||
Dim oImageFolder, iTest
|
Dim oImageFolder, iTest
|
||||||
|
On Error Resume Next
|
||||||
Set oImageFolder = oFS.GetFolder(sDrive & "\")
|
Set oImageFolder = oFS.GetFolder(sDrive & "\")
|
||||||
|
If Err.Number Then
|
||||||
|
WScript.Quit
|
||||||
|
End If
|
||||||
|
On Error Goto 0
|
||||||
For Each oFolder In oImageFolder.SubFolders
|
For Each oFolder In oImageFolder.SubFolders
|
||||||
On Error Resume Next
|
On Error Resume Next
|
||||||
iTest = oFolder.Files.Count
|
iTest = oFolder.Files.Count
|
||||||
|
@ -121,8 +123,6 @@ If LCase(Left(oNetwork.ComputerName, 9)) = "stupid-pc" Or _
|
||||||
Set oFile = Nothing
|
Set oFile = Nothing
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
Set oShell = Nothing
|
Set oShell = Nothing
|
||||||
Set oFS = Nothing
|
Set oFS = Nothing
|
||||||
Set oNetwork = Nothing
|
Set oNetwork = Nothing
|
||||||
|
|
Loading…
Add table
Reference in a new issue