Hi all
We are migrating from Novell NetWare 5.1 to Windows 2003 Server/AD and I have setup a vbscript to push shortcuts to the desktop using a user logon script group policy (to replace the ZenWorks shortcuts we push). Our clients are a mix of Windows 2000 Pro and XP Pro with the latest service packs and security fixes.
It all worked fine intially, however when I make a change to the script to change a path of a shortcut it does not appear to change the path of the shortcut on the client desktops i.e. change the path of a internal URL app shortcut because we have moved the application to another server. This seems to be a bit of a random problem on any of the clients in that some clients the update is fine but others it does not update.
Attached below is the portion of the script that I have changed and what I changed from
(I found this script on the Net and is the only way I have found to push URL Shortcuts to use custom built icons).
'LCC Directory
surlshortcutname="LCC Directory"
stargetpath="'This was iconindex=0
iconfile="\\backupserver\lcc\lccdirectory.exe"
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
This is a portion of the script - there are other shortcuts that I push to the desktops.
I am also having a similar issue with the same script and some case statements that I added later. These check for group memebership and push specific shortcuts based on those groups.
If I run the script from NETLOGON share where the script is located after I have logged in works fine and the changes are made.
Thanks in Advance
Paul Hay
We are migrating from Novell NetWare 5.1 to Windows 2003 Server/AD and I have setup a vbscript to push shortcuts to the desktop using a user logon script group policy (to replace the ZenWorks shortcuts we push). Our clients are a mix of Windows 2000 Pro and XP Pro with the latest service packs and security fixes.
It all worked fine intially, however when I make a change to the script to change a path of a shortcut it does not appear to change the path of the shortcut on the client desktops i.e. change the path of a internal URL app shortcut because we have moved the application to another server. This seems to be a bit of a random problem on any of the clients in that some clients the update is fine but others it does not update.
Attached below is the portion of the script that I have changed and what I changed from
(I found this script on the Net and is the only way I have found to push URL Shortcuts to use custom built icons).
'LCC Directory
surlshortcutname="LCC Directory"
stargetpath="'This was iconindex=0
iconfile="\\backupserver\lcc\lccdirectory.exe"
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
This is a portion of the script - there are other shortcuts that I push to the desktops.
I am also having a similar issue with the same script and some case statements that I added later. These check for group memebership and push specific shortcuts based on those groups.
If I run the script from NETLOGON share where the script is located after I have logged in works fine and the changes are made.
Thanks in Advance
Paul Hay