Link to home
Start Free TrialLog in
Avatar of jerrywalk1
jerrywalk1

asked on

create shortcut to users home drive

I need a simple script that will run in setup.bat when users log on that will take their U drive which is their home drives and create a desktop shortcut. Everyone uses the U drive as this is setup in the AD users profiles.
Windows 2003 R2
desktops/laptops windows 7
Avatar of Michael Ortega
Michael Ortega
Flag of United States of America image

I'm a little confused as to what you're trying to accomplish.  Is the U drive a mapped drive shared off the server?  If so, you may consider creating a Group Policy to automatically map the drive for each user that needs it.

BB
Avatar of jerrywalk1
jerrywalk1

ASKER

The network drive is already mapped. All i am trying to do is a script that will create a desktop shortcut to that drive letter.
Something like this?  It would need a bit of tweaking as I do not know the location of the U drive in your network.

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("WScript.Shell")

    DesktopPath = objShell.SpecialFolders("Desktop")
    Set NewShortcut = objShell.CreateShortcut(DesktopPath & "\Udrive.lnk")

    If Not objFSO.FileExists (NewShortcut) Then
    NewShortcut.Description = "U Drive"
    NewShortcut.IconLocation = "%SystemRoot%\system32\SHELL32.dll,88"
    NewShortcut.TargetPath = "\\server\locationofUdrive"
    NewShortcut.Save
    End If

    Set objFSO = nothing
    Set objShell = nothing

    WScript.Quit

BB
ASKER CERTIFIED SOLUTION
Avatar of Spike99
Spike99
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial