The thing is, that sometimes, if I turn on HTPC and the NetDrive remains off, and I turn it on AFTER HTPC boots, it still sees network drive as offline. Connected, but offline. And if you ask why would I use drive instead of UNC path, it's ismply because then I can open movies from Zoom. If I used UNC path, there's no way to open files from Zoom's navigator.
Anyway, for a long time I used this script which simply maps drive. It is VBS, since .NET doesn't support drive mapping natively.
' --------------------------------------------------------------------------------------
' *** VisualX *** Created by Dalibor Lanik 2006
' --------------------------------------------------------------------------------------
Option Explicit
Dim WshNet
Set WshNet = WScript.CreateObject("WScript.Network")
On Error Resume next
WshNet.MapNetworkDrive "V:", "\\Netcenter01\Files"
Wscript.quit
This maps drive if it's not mapped, but it still fails to open it, and the drive remains offline when I run Zoom.
I eventualy had to run Total Commander and open drive V: (my net drive) in order to make it online.
I came to this XScriptNG solution which is included in my Visual GM skin, but not everyone may notice it there. It maps drive, and then does DIR, which makes it online.
' --------------------------------------------------------------------------------------
' *** VisualX *** Created by Dalibor Lanik 2007
' --------------------------------------------------------------------------------------
Imports System.Diagnostics
Module Script
Public Sub Main()
Dim nri As Integer
Dim StrPath, ContentItem As String
Dim myProcess As Process = new System.Diagnostics.Process()
StrPath = "V:\"
myProcess.StartInfo.FileName = "net"
myProcess.StartInfo.Arguments = "use v: \\Netcenter01\Files"
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden
myProcess.Start
myProcess.WaitForExit()
myProcess.Close()
nri = 0
If (System.IO.Directory.Exists(StrPath)) Then
ContentItem = Dir(StrPath + "*.*")
Do Until ContentItem = ""
nri = nri + 1
ContentItem = Dir()
Loop
End If
End Sub
End Module
Hope someone finds it useful.
D.