|
-
Dec 4th, 2000, 06:37 PM
#1
Thread Starter
Lively Member
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.
-
Dec 5th, 2000, 10:00 AM
#2
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|