Установка ярлыка на рабочий стол с помощью vbs скрипта
Code
#Include "windows.bi"
#include "win\shlobj.bi"
#Include "win\imagehlp.bi"
Dim As ZString*512 path
Dim As String _
program = "Notepad.exe", _
label = "Notepad.lnk"
Dim As LPITEMIDLIST lpci
SHGetSpecialFolderLocation(0,CSIDL_DESKTOPDIRECTORY,@lpci)
SHGetPathFromIDList(lpci,@path)
Open Path+"\temp.vbs" For Output As #1
If Err>0 Then
MessageBox(0,"Ошибка не могу создать файл скрипта","ERROR",MB_ICONERROR)
Else
Print #1, !"Set oWS = WScript.CreateObject(\"WScript.Shell\")"
Print #1, !"sLinkFile = \"" & path & "\" & label & """"
Print #1, "Set oLink = oWS.CreateShortcut(sLinkFile)"
Print #1, "oLink.TargetPath = " & """" & program & """"
Print #1, "oLink.Save"
Close #1
shell("WScript.exe" " "+path+"\temp.vbs")
Kill(Path+"\temp.vbs")
EndIf