Hello Anna,
Please give this code sample a try.
Howard found an issue with this UDF that I'll post to Shawn. Copy the code below and edit as required.
Let us know if you have problems with it.
code:
dim $Desktop,$UpdateBackupLink,$Pause
$Desktop=readvalue('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders','Desktop')
$UpdateBackupLink = WshShortCut($Desktop+'\'+'Backup Username.bat.lnk','\\labup2\scripts$\2000backup.bat',@USERID,'\\labup2\scripts$\','%SystemRoot%\system32\SHELL32.dll,6')
? 'Shortcut creation: '+@error+' '+@serror
get $Pause
Function WshShortCut( $path, $targetpath, optional $arguments, optional $startdir, optional $iconpath, optional $style)
Dim $shell,$shortcut
$shell = createobject("wscript.shell")
if $shell
$shortcut = $shell.createshortcut($path)
if $shortcut
$shortcut.targetpath = $targetpath
if $arguments
$shortcut.arguments = $arguments
endif
if $startdir
$shortcut.workingdirectory = $startdir
endif
if $iconpath
$shortcut.iconlocation = $iconpath
endif
if $style
$shortcut.windowstyle = $style
endif
$shortcut.save
$shortcut = 0
endif
$shell = 0
endif
exit @error
EndFunction