SHORTCUT -F -T "target" -N "name" -D "directory"
or if you use KiXtart as your logon script you would have
something that looks like ...
$SName = "name"
$STarget = "target"
$SDir = "directory"
$SDest = "destination"
$RCODE = AddProgramItem($STarget,$SName,"",0,$SDir,0,0)
Copy "SMPDIR\$SName.lnk" $SDest
$RCODE = DelProgramItem($SName)
or using VBS & WSH you can delete broken shortcuts, create
shortcuts, and remove embedded File Links from shortcuts
(I like to use Windows 98 to creat shortcuts - no embedded
UNC path names). see
http://www.microsoft.com/technet/treeview/default.asp?
url=/technet/scriptcenter/dfs/default.asp
for more info,
Use Shortcut.exe or SCUT.EXE (google for it)
Both are non-gui command line tools.
Reinhardt
> or using VBS & WSH you can delete broken shortcuts, create
> shortcuts, and remove embedded File Links from shortcuts
Hi
Actually, with VBS & WSH you can edit (change) the properties of an existing
shortcut as well :-)
--
torgeir
>.
>
Hi
Ok, here is a VBScript that searches through all shortcuts on the users desktop
as well as "All Users" desktop:
Set oNetwork = CreateObject("WScript.Network")
' String in the target property to search for
sTargetStrOld = "\\anaconda01\" & oNetwork.UserName
' New string to set
sTargetStrNew = "P:\" & oNetwork.UserName
Set oShell = CreateObject("WScript.Shell")
set oFso = CreateObject("Scripting.FilesystemObject")
' Check all shortcuts on the users desktop
sPath = oShell.SpecialFolders("Desktop")
ChkLnk(sPath)
' Check all shortcuts on the "All Users" desktop
sPath = oShell.SpecialFolders("AllUsersDesktop")
ChkLnk(sPath)
Sub ChkLnk (sFolder)
Set oFolder = oFso.GetFolder(sFolder)
Set oFiles = oFolder.Files
For Each oFile In oFiles
If LCase(oFso.GetExtensionName(oFile)) = "lnk" Then
Set oLnk = oShell.CreateShortcut(oFile)
If LCase(oLnk.TargetPath) = LCase(sTargetStrOld) Then
oLnk.TargetPath = sTargetStrNew
oLnk.Save
End If
End If
Next
End Sub
--
torgeir
>.
>
> The situation is that we have Win98, NT and 2000 users. I
> don't think NT will support VBS by nature.
If your clients have IE 5.0 or higher, WSH (VBScript) should be available.
--
torgeir
;=====================================
$WindowsNT = 1
$Windows9x = 2
$Platform = @InWin
Select
Case $Platform = $WindowsNT
; Do NT/2000/XP stuff here.
Case $Platform = $Windows9x
; Do 95/98/ME stuff here.
EndSelect
;=====================================
If you need to check the version of each platform, then use the macro @DOS,
like this:
;=====================================
$WindowsNT = 1
$Windows9x = 2
$Platform = @InWin
$Winver = @Dos
Select
Case $Platform = $WindowsNT
Select
Case $Winver = "5.1"
; Do XP stuff here.
Case $Winver = "5.0"
; Do 2000 stuff here.
Case $Winver = "4.0"
; Do NT4 stuff here.
EndSelect
Case $Platform = $Windows9x
; Do 95/98/ME stuff here.
EndSelect
;=====================================
Depending on what you meant by "personal folder", you might be able to use
the KiXtart macros @HomeDir, @HomeDrive and @HomeShr.
If you know the name of the existing shortcut, then just replace it with a
new one using KiXtart. If you don't know the exact name, it will be a lot
trickier. You will have to enumerate through all the .LNK files and then
use a program like the Shortcut.exe I wrote to examine the contents, and
then decide if it needs to be updated or not.
Your best bet is WSH/VBS, which is supported on NT4, but if it's not already
installed you might not want to do all that work to get it installed.
<compu...@hotmail.com> wrote in message
news:614101c2490e$802dcc10$a4e62ecf@tkmsftngxa06...
RD
>.
>