Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > shared drive access


Reply
Fix Vista Errors
Thread Tools Display Modes

shared drive access

 
 
Kim K
Guest
Posts: n/a

 
      12-14-2009
Let me stsart off by apologizing if I am posting in the wrong place!

I have a server 2003 with many drives shared to certain groups, the groups
have a bat file set to attach this drive upon start up. Occasionally the
drive fails to launch but upon reboot will grab it. Why does this happen and
how can I help to correct the problem so that it minimizes my issue?

Thanks!
 
Reply With Quote
 
 
 
 
Pegasus [MVP]
Guest
Posts: n/a

 
      12-14-2009



"Kim K" <> schrieb im Newsbeitrag
news:92DBA312-5CEB-4195-9EA9-...
> Let me stsart off by apologizing if I am posting in the wrong place!
>
> I have a server 2003 with many drives shared to certain groups, the groups
> have a bat file set to attach this drive upon start up. Occasionally the
> drive fails to launch but upon reboot will grab it. Why does this happen
> and
> how can I help to correct the problem so that it minimizes my issue?
>
> Thanks!


Your first step should be to ascertain that the batch file really failed to
launch. You can do it by adding just one line to it, e.g. like so:
@echo off
echo %date% %time% %UserName% %Userdomain% >> "%temp%\logon.txt"
[Your own code goes here]

Next time someone complains that his shares failed to materialise, examing
the log file. To ensure that you capture both domain and local logon events,
place the above lines also into the file c:\documents and settings\all
users\start menu\programs\startup\netlogon.bat.

 
Reply With Quote
 
DaveMills
Guest
Posts: n/a

 
      12-15-2009
On Mon, 14 Dec 2009 23:16:37 +0100, "Pegasus [MVP]" <> wrote:

>
>
>"Kim K" <> schrieb im Newsbeitrag
>news:92DBA312-5CEB-4195-9EA9-...
>> Let me stsart off by apologizing if I am posting in the wrong place!
>>
>> I have a server 2003 with many drives shared to certain groups, the groups
>> have a bat file set to attach this drive upon start up. Occasionally the
>> drive fails to launch but upon reboot will grab it. Why does this happen
>> and
>> how can I help to correct the problem so that it minimizes my issue?
>>
>> Thanks!

The batch file can fail to run for various reasons. For example the user has
unplugged the network cable or there is a Wi-Fi issue. Actually the batch file
may start but fail after a few lines. I wrote the following script to help with
this. The basic principal is to allow Persistent Mappings which will remain in
place when the script fails.

I also think it will be faster than deleting and recreating the drive mapping in
most cases.

<script>
'Copyright D J Mills, www.djmills.co.uk 2009
'Script to map the network drives for staff.
'It first checks to see if the drive is already mapped to the correct UNC.
'If it is it leaves it alone. If not it deletes the mapping
'Finally it adds in the correct mapping. This picks up any situation where the
mapping
'did not exist in the first place.
'Using a persistent connection resolves the issue where the user logs on but the
script does not run.

Dim objNetwork
Set objNetwork = WScript.CreateObject("WScript.Network")

Dim colDrives

Set colDrives = objNetwork.EnumNetworkDrives

'On error resume next

'Specify the drive mappings required in a list of calls as below.
Call ReMapDrive("G:","\\Domain\storage\Sims",colDrives)
Call ReMapDrive("J:","\\Domain\storage\Public",colDrive s)
Call ReMapDrive("N:","\\Domain\storage",colDrives)
Call ReMapDrive("S:","\\Domain\storage\Staff",colDrives )
Call ReMapDrive("T:","\\Domain\storage\Departments",col Drives)
Call ReMapDrive("X:","\\Domain\storage\Shared",colDrive s)

Sub ReMapDrive(strDrive,strUNC,colDrives)
'strDrive = Drive letter and ":" e.g. "X:"
'strUNC = UNC to map, e.g. \\AD\STORAGE\SETUP
'colDrives = collection of existing mapped drives from EnumNetworkDrives

Dim bForce, bUpdateProfile

bforce = True
bUpdateProfile = True

'msgbox strDrive & " -> " & strUNC

'msgbox colDrives.Count

For i = 0 to (colDrives.Count-1) Step 2
If colDrives.Item(i) = strDrive Then 'Is this the requested
drive?
'msgbox strDrive & "->" & colDrives.Item(i+1) & ">>>" & strUNC
If colDrives.Item(i+1) = strUNC Then 'Is it correctly mapped
Exit Sub
Else
'msgbox "Remove Mapping " & colDrives.Item(i)
objNetwork.RemoveNetworkDrive colDrives.Item(i),bForce,bUpdateProfile
'msgbox "Remove Mapping " & colDrives.Item(i)
End If
End If
Next

'We either did not find the drive or found it was incorrect and removed it
'So map it correctly as requested.
objNetwork.MapNetworkDrive strDrive, strUNC, "True"

End Sub
</script>

>
>Your first step should be to ascertain that the batch file really failed to
>launch. You can do it by adding just one line to it, e.g. like so:
>@echo off
>echo %date% %time% %UserName% %Userdomain% >> "%temp%\logon.txt"
>[Your own code goes here]
>
>Next time someone complains that his shares failed to materialise, examing
>the log file. To ensure that you capture both domain and local logon events,
>place the above lines also into the file c:\documents and settings\all
>users\start menu\programs\startup\netlogon.bat.

--
Dave Mills
There are 10 types of people, those that understand binary and those that don't.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
shortcuts on shared server drive don't resolve correctly? geek-y-guy Server Networking 3 12-10-2009 11:17 PM
Windows Vista and Hard drive recognition. 1maintenance Windows Vista Hardware 5 01-20-2008 01:52 PM
Removing "Reader" shared access to folders? MarkF Windows Vista Administration 2 04-07-2007 09:06 PM
Installation to second drive KSchrantz Windows Vista Installation 0 08-26-2006 06:15 PM
Stop Error 0x0000007b Louis LeBrun Windows Vista Installation 17 07-05-2006 09:00 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59