![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | script to create shortcut on user desktop Hi, there: This is a Wscript question, I can't find a dedicated group for windows scipting, so I post here. I am a new with script and look around on Microsoft website for a solution to my problem: Basically I would like to use logon script with group policy in Windows server 2003 to achieve the following goal: 1): create a shortcut in user’s desktop, the target of this shortcut is a share folder on file server. When I search the Microsoft website, I write the following script: objWSHShell = CreateObject("Wscript.Shell") strDesktop = objWSHShell.SpecialFolders("Desktop") strShortcutName="Corporate Public Folder" strShortcutPath="\\w2k3chsvr\public" objShortcut=objWSHShell.creatShortcut(strDesktop + "\" + strShortcutName + ".lnk") objShortcut.TargetPath=strShortcutPath objShortcut.Save I create a script file with name “logon.wsf” on a test XP machine and run the file, however it pops up an error window saying “on jobs are define in the file”, Now I wonder what should be added to this scipt file. thanks |
My System Specs![]() |
| | #2 (permalink) |
| | Re: script to create shortcut on user desktop Hello Huang, for this issue i would use Batch/Commandline because the Shortcut you want to deploy is always the same. 1. create the Shortcut for the Folder once on your own desktop (Corporate Public Folder.lnk) 2. copy it once to the Logonshare of the logonserver 3. Put the following line in the common logonscript: if not exist "%userprofile%\Desktop\Corporate Public Folder.lnk" (copy "%LOGONSERVER%\Netlogon\Corporate Public Folder.lnk" "%userprofile% \Desktop\Corporate Public Folder.lnk") Best regards BJ Huang schrieb: Quote: > Hi, there: > > This is a Wscript question, I can't find a dedicated group for windows > scipting, so I post here. > > I am a new with script and look around on Microsoft website for a solution > to my problem: > > > Basically I would like to use logon script with group policy in Windows > server 2003 to achieve the following goal: > > > > 1): create a shortcut in users desktop, the target of this shortcut isa > share folder on file server. > > > > When I search the Microsoft website, I write the following script: > > > > objWSHShell = CreateObject("Wscript.Shell") > > strDesktop = objWSHShell.SpecialFolders("Desktop") > > > > strShortcutName="Corporate Public Folder" > > strShortcutPath="\\w2k3chsvr\public" > > > > objShortcut=objWSHShell.creatShortcut(strDesktop + "\" + strShortcutName + > ".lnk") > > objShortcut.TargetPath=strShortcutPath > > objShortcut.Save > > > > I create a script file with name logon.wsf on a test XP machine andrun > the file, however it pops up an error window saying on jobs are definein > the file, > > Now I wonder what should be added to this scipt file. > > > thanks |
My System Specs![]() |
| | #3 (permalink) |
| | Re: script to create shortcut on user desktop Hello Huang, as first I found a literal problem in "objShortcut=objWSHShell.creatShortcut", better you write "objShortcut=objWSHShell.createShortcut". How ever, I got your script running after some modifications inside the script and renaming the script file to "logon.vbs". This works perfect on my environment ... ___________________________ Set objWSHShell = WScript.CreateObject("Wscript.Shell") strDesktop = objWSHShell.SpecialFolders("Desktop") strShortcutName = "Corporate Public Folder" strShortcutPath = "\\w2k3chsvr\public" Set objShortcut = objWSHShell.CreateShortcut(strDesktop & "\" + strShortcutName & ".lnk") objShortcut.TargetPath=strShortcutPath objShortcut.Save ___________________________ Best regards from Germany, Uwe Am 11.03.2009, 01:34 Uhr, schrieb Huang <Huang@xxxxxx>: Quote: > Hi, there: > > This is a Wscript question, I can't find a dedicated group for windows > scipting, so I post here. > > I am a new with script and look around on Microsoft website for a > solution > to my problem: > > > Basically I would like to use logon script with group policy in Windows > server 2003 to achieve the following goal: > > > 1): create a shortcut in user’s desktop, the target of this shortcut is a > share folder on file server. > > > When I search the Microsoft website, I write the following script: > > > objWSHShell = CreateObject("Wscript.Shell") > > strDesktop = objWSHShell.SpecialFolders("Desktop") > > > strShortcutName="Corporate Public Folder" > > strShortcutPath="\\w2k3chsvr\public" > > > objShortcut=objWSHShell.creatShortcut(strDesktop + "\" + strShortcutName > + > ".lnk") > > objShortcut.TargetPath=strShortcutPath > > objShortcut.Save > > > I create a script file with name “logon.wsf” on a test XP machine and run > the file, however it pops up an error window saying “on jobs are define > in > the file”, > > Now I wonder what should be added to this scipt file. > > thanks > -- Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/ |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: Cannot create desktop shortcut | Vista General | |||
| Create a shortcut to change user | Vista account administration | |||
| Help with Script to Create and Share User Directory | PowerShell | |||
| Create shared desktop shortcut | Vista General | |||
| send to desktop, create shortcut?? | Vista General | |||