Jump to content

Recommended Posts

Posted

Hello.

Because i was unable to get the "copy the lnk files as is" working, i created this simple VBScript that can be used to create Real Link.

Here the code:

Dim WSHShell, fs, BaseMenuFolder, dPrograms

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

'Set this to the appropriate base folder - In this example, i use "Menu Avvio\Programmi" because I
'have a Localized Version of XP - ATTENTION: Remember not to put the final Slash here!!!
BaseMenuFolder="\Documents and Settings\All Users\Menu Avvio\Programmi"

Function ASHMakeShortcut( name, target )
Dim Shortcut,StartupPath
Dim dPath

dPath = mid(fs.GetSpecialFolder(WindowsFolder),1,2) & BaseMenuFolder

Set Shortcut = WSHShell.CreateShortcut(dPath & "\" & name & ".lnk")
Shortcut.TargetPath = target
StartupPath = fs.GetParentFolderName( target )
If fs.FolderExists( StartupPath ) then
 Shortcut.WorkingDirectory = StartupPath
End If

Shortcut.Save

End Function

'If you want to link some kind of file that goes to "Programs" Folder you have to customize this
' - Again remember the final slash!

dPrograms = mid(fs.GetSpecialFolder(WindowsFolder),1,2) & "\Programmi"
ASHMakeShortcut "Shortcut to Media Player Classic", dPrograms & "\Media Player Classic\mplayerc.exe"

Ah: Save it as .vbs ! ^_^

All the things after the ' are intended to be comments.

If you find any mistake, please report it to me.

If you find any improvements... do the same :)

Thanks and sorry for my bad english - I'm Italian ^_^

See Ya


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...