Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange Issue when creating shortcut

Status
Not open for further replies.

supportahm1980

Technical User
May 30, 2006
208
US
Hi I put the script below in user section-> logon script of the local group policy on a citrix server.

My goal was to have the script run at logon to have a desktop link going to their physical hard drive.

The problem is when I right click on the link after the user logs in it shows the target as
c:\document\joesmith\desktop

It is missing the and settings. Also when a user name is longer the 8 characters it does not display. Also notice document is 8 characters. I will eventually put into a log on script in the domain but for now I wanted to test this out.

I noticed in the Group policy there is a section named "Script parameters" I do not know what that is or if needed.

I dont know what I am doing wrong. It works fine when I double click the script.


Code:
Set objShell = CreateObject("Wscript.Shell")
Set objNetwork = WScript.CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")


strUser = objNetwork.UserName



strFavs = ObjShell.SpecialFolders("Desktop")
	strshortcut = strFavs & "\Local Desktop.lnk"
	
    	SET oUrlLink = ObjShell.CreateShortcut(strshortcut)
    	oUrlLink.TargetPath = "c:\documents and settings\" & strUser & "\desktop"
    	oUrlLink.Save
 
Try:

Code:
oUrlLink.TargetPath =  Chr(34) & "c:\documents And settings\" & strUser & "\desktop" & Chr(34)

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top