Jump to content

Recommended Posts

Posted

Hi folks,

 

We have some historic VB scripts that map drive letters.

 

I'm loathed to tinker with them, although at some point I will switch to completely GPO based. For the moment I'd just like to get them working properly.

 

The scripts are launched from a GPO.

 

In Win 7 they run fine. In Win 8 they don't launch for the first few minutes, and rarely don't seem to launch at all.

 

I have no idea why there is this long delay, and I'm struggling to know where to start to troubleshoot.

 

The scripts are essentially as follows, albeit I have edited them to give just one example for brevity:

 

Option Explicit

Dim objNetwork, strDrive, objShell, objUNC

Dim strRemotePath1, strRemotePath2, strRemotePath3, strRemotePath4, strRemotePath5, strRemotePath6

Dim strDriveLetter1, strDriveLetter2, strDriveLetter3, strDriveLetter4, strDriveLetter5, strDriveLetter6

Dim strNewName1, strNewName2, strNewName3, strNewName4, strNewName5, strNewName6

'

strDriveLetter1 = "F:"

 

strRemotePath1 = "\\va-file1\Finance$"

 

strNewName1 = "Finance"

 

' Section to map the network drives

Set objNetwork = CreateObject("WScript.Network")

objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1

 

' Section which actually (re)names the Mapped Drive

Set objShell = CreateObject("Shell.Application")

objShell.NameSpace(strDriveLetter1).Self.Name = strNewName1

 

' End of script.

 

Any ideas?

 

TIA

Posted (edited)
I have no idea why there is this long delay

Microsoft doesn't want you to use logon (or startup) scripts.

 

With Windows 8.x there is a 5 minute delay by default.

 

I would switch to using GPP for drive mapping.

 

For mapping drives, settings registry values, etc. consider Group Policy Preferences

GPP is old news, but can’t be ignored in this discussion. For many client-centric startup and logon script scenarios there are alternatives like GPP: Registry, GPP: Environment, and so on. The rarely discussed advantage of GPP is that (for the most part) it doesn't have to block your logon waiting for the network during boot. GPP items can run in the background during the day when the machine is stable and online. Starting with Windows 8.1 even GPP: Drive Maps can run asynchronously (not logon blocking).

Edited by Arthur
  • Thanks 1
Posted

8.1 by any chance?

 

Login scripts are auto delayed for 5 minutes unless you've modified the registry etc, as they don't want you doing that anymore to improve performance

 

Steve

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...