supportahm1980
Technical User
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.
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