I was looking for a simple way to create a desktop icon for a program which I have installed just by copying the EXEs and DLLs into a new folder. May be that someone here can use it:
subroutine create_vbs()
c creates and runs a Visual-Basic-Script for a shortcut
IMPLICIT NONE
INCLUDE <WINDOWS.INS>
integer*4 j
character*256 path_1,path_2,string,getenv@
c
c in this example, MYPROG is the name of the programme for which
c a desktop icon should be created
c
path_1 = ' '
path_2 = ' '
path_1 = getenv@('USERPROFILE')
path_2 = getenv@('PROGRAMFILES')
call append_string@(path_2,'\\MYPROG')
open(10,file='shortcut.vbs',err=900,status='unknown')
write(10,'(A)',err=900)
* 'Set oWS = WScript.CreateObject('WScript.Shell')'
string = ' '
string = 'sLinkFile = ''
call append_string@(string,path_1)
call append_string@(string,'\\DESKTOP\\MYPROG.LNK'')
write(10,'(A)',err=900)string
write(10,'(A)',err=900)
* 'Set oLink = oWS.CreateShortcut(sLinkFile)'
string = ' '
string = 'oLink.TargetPath = ''
call append_string@(string,path_2)
call append_string@(string,'\\MYPROG.EXE'')
write(10,'(A)',err=900)string
write(10,'(A)',err=900)'oLink.Description = 'MYPROG''
string = ' '
string = 'oLink.IconLocation = ''
call append_string@(string,path_2)
call append_string@(string,'\\MYPROG.EXE, 0'')
write(10,'(A)',err=900)string
string = ' '
string = 'oLink.WorkingDirectory = ''
call append_string@(string,path_2)
call append_string@(string,''')
write(10,'(A)',err=900)string
write(10,'(A)',err=900)'oLink.Save'
900 close(10)
call cissue@('shortcut.vbs',j)
open(10,file='shortcut.vbs',err=910,status='old')
910 close(10,status='delete')
return
end
Regards - Wilfried