Results 1 to 2 of 2

Thread: Shortcuts and Start Menu Question

  1. #1

    Thread Starter
    Lively Member jonvantuyl's Avatar
    Join Date
    Nov 2000
    Location
    Michigan
    Posts
    75

    Smile

    Say that you have a folder with 5 sub folders, which each have 5 files inside of them,

    is there any way to create a program that creates short cuts for all of these files inside of the start menu folder. Where all u need to do is type in the location of the two folders.?? any help is great, thanks.

  2. #2
    Lively Member Ianf's Avatar
    Join Date
    Mar 2000
    Location
    Leigh, Lancashire, UK
    Posts
    96

    Talking Solution

    The following solution uses the FileSystemObject

    Dim Folder As Object
    Dim File As Object
    Dim FileCollection As Object
    Dim WSHShell As Object
    Dim MyShortcut As Object
    Dim RealFile As String

    Set FileSysObject = CreateObject("Scripting.FileSystemObject")
    Set WSHShell = CreateObject("WScript.Shell")

    Set Folder = FileSysObject.GetFolder("F:\Files\")
    Set FileCollection = Folder.Files
    For Each File In FileCollection

    RealFile = File.Name & ".lnk"
    Set MyShortcut = WSHShell.CreateShortcut("C:\WINNT\Profiles\All Users\Start Menu\Programs\Startup\" & "\Shortcut to " & RealFile)

    ' Set shortcut object properties and save it
    MyShortcut.TargetPath = File
    MyShortcut.Save

    Next


    Hope this helps
    Ian Frawley
    Software Engineer
    E-mail [email protected]

    BEING IN THERAPY
    And yet, having therapy is very much like making love to a beautiful woman. You... get on the couch, string 'em along with some half-lies and evasions, probe some deep dark holes, and then hand over all your money.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width