Opret genvej på client
<%Dim WshShell,surlshortcutname, stargetpath, iconindex, iconfile,sdesktop,ourllink,surllinkfile,fso,f,ots,contents,line
surlshortcutname="Intranet - Hesselholt" 'without extension
stargetpath="http://80.62.70.190:4080?Username=Ingeman"
'To use default, set these 2 variables to null (either one will do)
'If use existing setting, set them to empty string or comment them out (either one will do)
iconindex=0
iconfile="D:\web-hanstholm\Icon1.ico"
set wshshell=createobject("wscript.shell")
sDesktop=wshshell.specialfolders("Desktop")
set ourllink=wshshell.createshortcut(sDesktop & "\" & surlshortcutname & ".url")
ourllink.targetpath=stargetpath
ourllink.save
surllinkfile=ourllink.fullname
set ourllink=nothing : set wshshell=nothing
if isempty(iconindex) or isempty(iconfile) then
wscript.quit (0) 'existing urllink, if any, settings, are preserved
end if
set fso=createobject("scripting.filesystemobject")
set f=fso.getfile(surllinkfile)
set ots=f.openastextstream(1)
contents=""
do while not ots.atEndofstream
line=ots.readline
if instr(1,line,"IconIndex",1)=0 and instr(1,line,"IconFile",1)=0 then
contents=contents & line & vbcrlf
end if
loop
ots.close
if not (isnull(iconindex) or isnull(iconfile)) then
if not (isempty(iconindex) or isempty(iconfile)) then
contents=contents &"IconIndex=" & cstr(iconindex) & vbcrlf
contents=contents & "IconFile=" & iconfile
end if
end if
set ots=f.openastextstream(2)
ots.write contents
ots.close
set ots=nothing : set f=nothing : set fso=nothing
Response.Redirect("Blank.html")
%>
Denne kode opretter genvej på webserver - men hvordan skal den se ud hvis det skal være på klienten ?
