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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create local desktop shortcut in group policy

Status
Not open for further replies.

swm2win

IS-IT--Management
May 20, 2005
34
0
0
US
We are using roaming profiles for our staff, but each staff member needs to be able to open a specific file on their computers - but it's a different file per computer.

For instance, if Bob is using ComputerA, he needs to open the file on ComputerA's C drive. If he's on ComputerD, he needs the file from ComputerD, etc.

All computers have the same local path to the file. Can I add a login script to the group policy to create a shortcut on their desktops when they log in? Any ideas or code would be great!

Thanks!
 
I think this is straight forward. When they logon do you use a logon script at the moment? What you need is to have a shortcut on the local drive as well. So you would have as an example C:\temp and within there you would have temp.txt and shortcut to temp.txt

When your logon script runs add this line in:

copy /Y "C:\temp\shortcut to temp.txt" "%userprofile%\desktop\shortcut to temp.txt"

I am assuming you run a bat file for this solution.

 
Just tried the above script. It didn't seem to work.
 
Hi .. I have one sample script which create a desktop shortcut for notepad.exe. Modify it for ur requirements..

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")


Dim MyShortcut, MyDesktop, DesktopPath

' Read desktop path using WshSpecialFolders object
DesktopPath = WSHShell.SpecialFolders("Desktop")

' Create a shortcut object on the desktop
Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & "\Shortcut to notepad.lnk")

' Set shortcut object properties and save it
MyShortcut.TargetPath = WSHShell.ExpandEnvironmentStrings("%windir%\notepad.exe")
MyShortcut.WorkingDirectory = WSHShell.ExpandEnvironmentStrings("%windir%")
MyShortcut.WindowStyle = 4
MyShortcut.IconLocation = WSHShell.ExpandEnvironmentStrings("%windir%\notepad.exe, 0")
MyShortcut.Save

WScript.Echo "A shortcut to Notepad now exists on your Desktop."

' ********************
' *
' * Welcome
' *
Sub Welcome()
Dim intDoIt

intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _
vbOKCancel + vbInformation, _
L_Welcome_MsgBox_Title_Text )
If intDoIt = vbCancel Then
WScript.Quit
End If
End Sub



Hope this Helps :)

Aslam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top