Jump to content

Recommended Posts

Posted

So I have a need to create a bunch of shortcuts in a user logon script to network shares that may or may not be accessible. The problem I'm having is for my 15 or so shortcuts, it's taking 9 minutes to create all of them. I don't know why, I'm guessing Windows timeouts on the shares that aren't there. Is there a quicker way to create these shortcuts than FileCreateShortcut, or some flag to just create all of them in parallel?

  • Moderators
Posted

Why not first check for the directory on the share, and then create your shortcut? Something like this:

Local $aArray[5] = ["N:\Share", "H:\", "I:\IS", "T:\Bridger", "W:\Information Services"]
Local $x = 1

For $sDir In $aArray
    If FileExists($sDir) Then
        FileCreateShortcut($sDir, @DesktopDir & "\Shortcut " & $x)
        $x +=1
    EndIf
Next

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...