Page 1 of 1 1
Topic Options
#211950 - 2016-09-13 07:08 PM Copying shortcut to desktop
rgallatin Offline
Just in Town

Registered: 2016-09-13
Posts: 2
Loc: New York
I am trying to create copies of short cuts on the desktop of the members in a group in my AD Domain. The shortcuts are saved to a folder on my network. The group has Read, Write permissions to the folder that the shortcuts are saved in and the drive letter is mapped before the script to create the shortcut is run.

Here is the script that I am trying to use:

If InGroup ("AD GROUPNAME")
COPY "Mapped Drive Letter:\Folderlevel1\Folderlevel2\shortcutname.lnk" "%Userprofile%\Desktop\Shortcutname.lnk"
endif

When a user of the group logs in, the drive letter maps to the correct path, but the shortcut is not created.

Top
#211951 - 2016-09-13 09:06 PM Re: Copying shortcut to desktop [Re: rgallatin]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
Some suggestions...

If you really have to copy the shortcut and not create it...
 Code:
If InGroup ("AD GROUPNAME")
  ? "Copying Shortcut"
  COPY "Mapped Drive Letter:\Folderlevel1\Folderlevel2\shortcutname.lnk" "%Userprofile%\Desktop\Shortcutname.lnk"
  ? @serror
else
  ? "Not In Group"
endif


If you want to create a shortcut, see...
wshShortcut -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=84115#Post84115

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1
_________________________
(... better days ahead)

Top
#211952 - 2016-09-13 09:26 PM Re: Copying shortcut to desktop [Re: Allen]
rgallatin Offline
Just in Town

Registered: 2016-09-13
Posts: 2
Loc: New York
Thank you Allen, that worked, not being one who has done a lot of scripting, I am guessing that the "else" statement is what allowed it to work?

Yes, I am required to use the copy rather than create, I won't get into that though.

Top
#211953 - 2016-09-13 09:40 PM Re: Copying shortcut to desktop [Re: rgallatin]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
I can't say it could possibly do that... it was there purely to display if you were in the group or not.
_________________________
(... better days ahead)

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 1383 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.054 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

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