> Procedure CreateShortcut (pShortcutName, pTargetPath, pParameters, pWorkingDir, pIconLoc, pDescription) >*--------- -------------- > >* Example: >* >* cShortcutName = "C:\Temp\Teste" - Where Shortcut will be placed >* cTargetPath = "C:\Pointer\FoxProgs\Acessos\acessosusr.exe" - Program to be executed >* cParameters = "'Action=Request UserId=Pointer WhoAmI=RU'" - Parameters (optional) >* cWorkingDir = "C:\Pointer\FoxProgs\Acessos" - Working directory for executing program >* cIconLoc = "C:\Pointer\FoxProgs\Acessos\acessosusr.exe" - Shortcut Icon location >* cDescription = "Autorização de Solicitação de Acessos" - Comments > > Local cShortcutName, cTargetPath, cParameters, cIconLoc, cDescription > Local WshShell , oShellLink > > cShortcutName = ForceExt (AllTrim (pShortcutName), "Lnk") > cTargetPath = AllTrim (pTargetPath ) > cParameters = AllTrim (pParameters ) > cWorkingDir = AllTrim (pWorkingDir ) > cIconLoc = AllTrim (pIconLoc ) > cDescription = AllTrim (pDescription ) > > If Empty (cWorkingDir) > cWorkingDir = JustPath (cTargetPath) > endif > > If Empty (cIconLoc) > cIconLoc = cTargetPath > endif > > If Empty (cDescription) > cDescription = JustFName (cTargetPath) > endif > > oWshShell = CreateObject ("Wscript.Shell") > oShellLink = oWshShell.CreateShortcut ( cShortcutName ) > > oShellLink.TargetPath = cTargetPath > oShellLink.Arguments = cParameters > oShellLink.WorkingDirectory = cWorkingDir > oShellLink.IconLocation = cIconLoc > oShellLink.Description = cDescription > > oShellLink.Save () > > EndProc && of CreateShortcut >