how to modify the following script to add a shortcut to XP desktop

H

Huang

Hi, there:



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.



after 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 “no jobs are define in
the fileâ€,

Now I wonder what should be added to this scipt file.


thanks
 
P

Pegasus

Huang said:
Hi, there:



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.



after 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 "no jobs are define in
the file",

Now I wonder what should be added to this scipt file.


thanks

Your script lacks several "set" statements, it has typographical errors and
it confuses "+" operators with "&" operators. Best to ask the experts in the
scripting.vbscript newsgroup to help you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top