Page 1 of 1 1
Topic Options
#188529 - 2008-07-02 08:38 PM Creating shortcuts with WshShortcut without admin privileges
PetersonEB Offline
Just in Town

Registered: 2008-06-25
Posts: 4
Hello all,

Can anyone tell me whether it is possible to create shortcuts in the Start Menu when not running the logon script as a local admin? I am using the WshShortcut UDF, which is running fine until I log in as a regular user. I stripped down the code and separated it and it seems to error out when using the CreateShortcut method on line 2...

 Code:
$Shell=CreateObject("WScript.Shell")
$Shortcut=$Shell.CreateShortcut("c:\test.lnk)
$Shortcut.TargetPath="c:\windows\notepad.exe"
$Shortcut.Save


I tried this same code under VBScript (modified) and it works fine. I am running it on XP, but I get the same results on 2k. Does Kix treat COM objects differently than VBS?

Top
#188530 - 2008-07-02 08:43 PM Re: Creating shortcuts with WshShortcut without admin privileges [Re: PetersonEB]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4641
Loc: The Netherlands
You can use AdminScript Editor (ASE), RunAs, Runn As( note the double n), Kix2EXE and/or the tokenization feature that is build in in kix. This way you can relatively safe include a password and username to use when running the script that creates the shortcuts. If you do a search on one or all of them then you’ll loads of results showing you how to use it.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#188531 - 2008-07-02 10:07 PM Re: Creating shortcuts with WshShortcut without admin privileges [Re: Mart]
PetersonEB Offline
Just in Town

Registered: 2008-06-25
Posts: 4
Nevermind. It looks like admin privileges are not required after all. The problem was that I was only creating the folder for the shortcuts to be placed into in some situations. The user account I have been testing happened to bypass all the functions that would have created it first. That doesn't explaining that piece of script bombing with user privileges, but oh well.
Top
#188533 - 2008-07-02 11:07 PM Re: Creating shortcuts with WshShortcut without admin privileges [Re: PetersonEB]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4444
Loc: USA
There are a couple of wshshortcut udfs on this board. Could you provide a link to the one you are using?
Top
Page 1 of 1 1


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

Who's Online
0 registered and 158 anonymous users online.
Newest Members
anhkfr, adamlevine, katherinknul, phamthuy, xuantu075
17631 Registered Users

Generated in 0.028 seconds in which 0.012 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