Page 1 of 1 1
Topic Options
#1485 - 2000-01-24 03:41 AM AddProgramItem woes.
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
I'm trying to dynamically create desktop items at login using addprogramitem. The idea is to create the link then move it to the desktop folder. This is fine when using the administrator login, but fails for an end user login - I cannot locate the entry anywhere despite the fact that addprogramitem returns success ("0").
Maybe I'm misunderstanding the terminology - what is the "active program group" that the icon will be added to, and is there a way of changing it?
The login processing is being performed on Windows Terminal Server if that makes any difference.
The alternative is to use a native NT command to add the icons if there is such a thing.

Top
#1486 - 2000-01-24 11:51 AM Re: AddProgramItem woes.
Anonymous
Unregistered


There is a reskit utility called shortcut.exe (in flavours for windows 95/98 and NT) to make shortcuts in any place.
You can make them directly at the desktop when the users log on.

Top
#1487 - 2000-01-26 11:51 PM Re: AddProgramItem woes.
Anonymous
Unregistered


Couldn't you just copy the .LNK files to the c:\winnt\profiles\@userid\desktop directory.

We use this actual command and store the icons in the custom folders directory on the server.

$Command = "cmd /c xcopy " + $DQ + "\\$Server\Programs\CustomFolders\$GroupName\*.*" + $DQ + " " + $DQ + "c:\winnt\profiles\$UserName\*.*" + $DQ + "/s >NUL"

Shell $command

That way all you have to do is copy shortcuts to your servers and if the folder exists the files are copied otherwise nothing changes.

Hope this helps.

If you need more info let me know.

Top
#1488 - 2000-05-19 10:05 AM Re: AddProgramItem woes.
Anonymous
Unregistered


Be careful when copying lnk files in NT.
NT sometimes embeds an associative link to the computer it was copied from. If the orginal computer is on the network and a user clicks on the copied shortcut on another computer, you may receive an error "CANNOT ACCESS \\ORGINALCOMPUTER\C$\SHORTCUT.lnk"

We use a utility called shortcut and run SHORTCUT /s to remove this associations.

Top
#1489 - 2000-05-19 03:11 PM Re: AddProgramItem woes.
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Gang:

I'd be VERY careful with one's syntax - especially when writing directly to WORKSTATION user profiles !

This is just a heads-up for everyone in the future !

Here's the scenario ...

1) New NT user account is created in user manager
2) User logs into workstation for first time
3) NT creates workstation profile called c:\winnt\profiles\@userid
4) Scripts are written that reference c:\winnt\profiles\@userid
5) For some reason - user account gets corrupt - (happens with roaming profiles)
6) User account gets deleted from user manager
7) User account is re-created with same name as previous
8) User logs back into workstation with new account
9) NT finds cached version of old account - but SIDS are different
10) NT creates new workstation profile with @userid.000
11) Script no longer works !

Been there - done that !

I always reference workstation profiles with the following...

%userprofile%\desktop

Guaranteed to work every time !

Shawn.

[This message has been edited by Shawn (edited 19 May 2000).]

Top
#1490 - 2000-06-13 10:33 AM Re: AddProgramItem woes.
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Thanks for all the usefull responses guys.

The purpose of the original q. was to allow me to provide our non-technical admin staff with a method of creating individual user profiles whilst keeping them well away from NT policy admin. The users access their desktop on a Terminal Server + Metaframe server farm.

I've done this by defining a group for each resource ("MS Office", "Email", "Oracle" for example). At login the script scrubs any entries already in the users %userprofile%\desktop, then enumerates all the groups that the user is a member of. If there is a directory in the configuration share with the same name as the group then:
1. Any .lnk files are copied to the users desktop.
2. If a "logon.kix" is present it is run.

The logon.kix is a per-resource script used to set/create sane values for registry entries, and create directories necessary for the resource.

Drive mappings (group "Map C to client") and international settings (group "Locale UK") are also handled by group membership.

I know I've been a little verbose, but maybe the info will help someone else, or more likely expose a fundamental flaw in the design

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2419 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.059 seconds in which 0.032 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org