Check availability of mapped network drive

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
willhartley
Posts: 16
Joined: Sun Feb 04, 2007 4:13 pm

Check availability of mapped network drive

Post by willhartley »

I need to check the availability of a folder on a mapped network drive.
I have to use a mapped network drive because this is the method that the software on the server which is causing the problem requires. I cannot use a UNC path.

When I try and create a Folder/File availablility test I can only see the A: C: and D: drives on the server running the Agent, not any mapped network drives. Is there any way to make the mapped network drives show up ?

Will
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Re: Check availability of mapped network drive

Post by KS-Soft Europe »

willhartley wrote:I need to check the availability of a folder on a mapped network drive.
I have to use a mapped network drive because this is the method that the software on the server which is causing the problem requires. I cannot use a UNC path.
I do not understand why you can not use UNC path. Actually, mapped drive is just a letter assigned to the UNC path.
willhartley wrote:When I try and create a Folder/File availablility test I can only see the A: C: and D: drives on the server running the Agent, not any mapped network drives. Is there any way to make the mapped network drives show up ?
I assume, HostMonitor is started as service? In such case you will not see any mapped drives, because service is running in its own security context. If you stop the service and start HostMonitor as an application, you will be able to see mapped drives, because in such case HostMonitor uses security context of the logged in user. However, application will not work after you logoff.

Regards,
Max
willhartley
Posts: 16
Joined: Sun Feb 04, 2007 4:13 pm

Post by willhartley »

Thanks.

Is it possible to run the service under the context of a particular user ?

Will
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

willhartley wrote:Is it possible to run the service under the context of a particular user ?
You may specify particular user account into "Options" > "Service" tab. However, it does not help to see the mapped drives. Why do not you want to use UNC path? You do not know exact path? Other reasons?

Regards,
Max
willhartley
Posts: 16
Joined: Sun Feb 04, 2007 4:13 pm

Post by willhartley »

There is a piece of software running on the server which requires the z: drive to be mapped, it will not use UNC path.

If the Z: drive is not mapped the software generates a runtime error and crashes, I need to now if the z: drive exists and if it is not I can do some remedial action.

Will
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Then you should run HostMonitor as application.
If the Z: drive is not mapped the software generates a runtime error and crashes
Probably you may check that software instead of drive? You may use Process test method to check for running process. Unless this software starts from time to time and should not run all the time?

Regards
Alex
willhartley
Posts: 16
Joined: Sun Feb 04, 2007 4:13 pm

Post by willhartley »

I have a check for the process but even when it has brought up a runtime error on the screen the process is still running so I cannot detect that the failure ahs occurred.

Will
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

I think, you should setup the test using UNC path, because if UNC path is not accessible, mapped drive, that assigned to this UNC path, is not acessible either.

Regards,
Max
fishvict
Posts: 34
Joined: Tue Dec 16, 2003 10:47 am

Post by fishvict »

Here's a VBSCript I found to enumerate network drives on a system. You could modify it to suit your needs...

'
' EnumNetworkDrives.vbs - Windows Logon Script
' VBScript to Enumerate Network Drives
'.N.B. This script need mapped drives
' Author Guy Thomas http://computerperformance.co.uk/
' Version 1.8 - April 24th 2005
' -----------------------------------------------------------'
Option Explicit
Dim objNetwork, objDrive, intDrive, intNetLetter

' This is the heart of the script
' Here is where objDrive enumerates the mapped drives
Set objNetwork = CreateObject("WScript.Network")
Set objDrive = objNetwork.EnumNetworkDrives

' Extra section to troubleshoot
If objDrive.Count = 0 Then
WScript.Echo "Guy's warning: No Drives Mapped "
Wscript.Quit(0)
End If

' Here is the where the script reads the array
For intDrive = 0 To (objDrive.Count -1) Step 2
intNetLetter = IntNetLetter +1
WScript.Echo "UNC Path " & intDrive & " - " & objDrive.Item(intDrive)_
& " Mapped drive No : " & objDrive.Item(intDrive +1)
Next

Wscript.Quit(1)

' Guy's Script ends here
willhartley
Posts: 16
Joined: Sun Feb 04, 2007 4:13 pm

Post by willhartley »

thanks I will give this a try,

Will
Post Reply