davley2
(Fresh Scripter)
2002-11-22 11:39 AM
shortcut on user desktop..HELP!

I am using the following piece of script to try and copy an icon to everyone's desktop. The drive is mapped ok, but the icon is not copied. Why isn't it working? Help!

$desktop = READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")
IF INGROUP("test")=1
USE K: /DEL
USE K: "\\FILE_SRV\overdrive"
COPY "k:\MEDAX.lNK" $desktop
ENDIF


JochenAdministrator
(KiX Supporter)
2002-11-22 11:49 AM
Re: shortcut on user desktop..HELP!

hmmm ...

works ok for me !

is it during logon ? Then HKEY_CURRENT_USER could be the issue as it will most likely not accessible to logon scripts

Try to add in :

code:
$desktop ? ; displays path on console
get $ ; pauses script



JochenAdministrator
(KiX Supporter)
2002-11-22 11:51 AM
Re: shortcut on user desktop..HELP!

Ah yes,

and prepare for being hit by some 'Do not cross-post' replies [Big Grin]


Sealeopard
(KiX Master)
2002-11-22 03:46 PM
Re: shortcut on user desktop..HELP!

Please check out the FAQ forum as this is discussed in Copy a shortcut to the Desktop, Start Menu, etc. .

Also, since this shortcut is supposed to be availabe for all users, the appropriate place would rathger be the 'All Users' desktop since the user won't be able to delete the shortcut.

Finally, the COPY command supports UNC filename, thus the USE staement will not be necessary.

you can use
code:
? 'Error '+@ERROR+' - '+@SERROR

to display potential error messages.