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 a shortcut- PLEASE SOMEONE! 1

Status
Not open for further replies.

bran2235

IS-IT--Management
Feb 13, 2002
703
0
0
US
Hello everyone!

Can anyone give me a script that creates a simple shortcut for their desktop session (shortcut to Outlook)..

The path is:
"M:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE"

I tried creating the shortcut and placing it in a share- then calling it at logon using xcopy... long story... Can somebody help, please!???


MANY THANKS!!
Brandon
 
I agree with Marc-
I manage a farm of 25 PS4 servers (they all publish a desktop). YES- UNINSTALL OUTLOOK ALL TOGETHER OR YOU WILL HAVE ISSUES! Then do a fresh install!!! Much better, trust me.

This will get rid of your old shortcuts too :)

If you use GPO to redirct user's start menu, then after the un-install, just go to the startmenu DIR and delete the shortcut there too (manually).

What you'll be left with after the uninstall of 2000 and the FRESH install of 03 are these tasks:
- Customizing your Outlook 2003 .adm / GPO
- Create the new shortcut for user's redirected start menu
- Create a script (I used a .bat file running xcopy to copy a .lnk (outlook shortcut) to everyone's published/roaming desktop. This is a startup script that checks for one first, and if not found, it creates it!


hope this helps!

Brandon
 
Hi Bran2235,

So what your telling me is that if I completely remove Office 2000 from my Citrix servers, it will automatically remove the shortcuts from my users thin client desktop settings?(remember, they are receiving Office via Citrix published desktops).. so it will remove these shortcuts by just uninstalling Office 2000 at the servers??

Just want to be sure about this before I start digging for more code to do this....

thanks for all your help
hb101
 
If I understand your problem correctly you want to delete shortcuts from the thin clients and not the server where the Office installation exists. Is that correct?

If so, then assuming you know the actual names of the shortcuts:

Code:
On Error Resume Next
SET fso = Wscript.CreateObject("Scripting.FileSystemObject")
SET WshShell = WScript.CreateObject("WScript.Shell")
strFavs = WshShell.SpecialFolders("Desktop")
Set oFiles = fso.GetFolder(strFavs)
For Each oFile In oFiles.Files
	If lcase(oFile.Name) = "microsoft word.lnk" Then
		oFile.Delete True
	End If
Next

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Yes Marc definately.. the shortcuts are on the desktops and not where the Office installation exists..

your code looks good and I truly appreciate it!

Is there a way I can just append or just add my code to yours? Here's mine again... this adds the shortcut to the desktop..

set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop _
& "\Word.lnk")
oShellLink.TargetPath = _
"C:\Program Files\Microsoft Office\OFFICE11\winword.EXE"
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.IconLocation = _
"C:\Program Files\Microsoft Office\OFFICE11\winword.EXE, 0"
oShellLink.Description = "My word Shortcut"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save


hb101
 
Easy enough...
Code:
On Error Resume Next
SET fso = Wscript.CreateObject("Scripting.FileSystemObject")
SET WSHShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
Set oFiles = fso.GetFolder(strDesktop)
For Each oFile In oFiles.Files
    If lcase(oFile.Name) = "word.lnk" Then
        oFile.Delete True
    End If
Next
Set oShellLink = WSHShell.CreateShortcut(strDesktop _
  & "\Word.lnk")
oShellLink.TargetPath = _
  "C:\Program Files\Microsoft Office\OFFICE11\winword.EXE"
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.IconLocation = _
  "C:\Program Files\Microsoft Office\OFFICE11\winword.EXE, 0"
oShellLink.Description = "My word Shortcut"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save

But why do you set the working directory to be the desktop and not the users My Documents folder?

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Excellent Mark!

This is exactly what I need!

hb101 thanks you highly
[2thumbsup]
 
Hi Mark,

Sorry, didn't mean to avoid your question... I figured that since the shortcuts reside on the desktop -it would be the right working directory setting. I could try the users My Docs and see what you mean.. Would it matter drastically?

thanks again!

hb101
 
By setting the working directory to be the desktop the temp files created for docs can show up there and cause confusion. I would just set it to the MyDocs location.


I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Hi Mark-

your script combined with mine worked great at home. I got to the office and I noticed that the users Office shortcuts are "Microsoft Word" or "Microsoft Excel etc etc. If I go into your script and type Microsoft Word.lnk instead of just Word.lnk .. it doesn't remove the shortcut. any ideas? it seems to only work if the .lnk is Word, or excel..

Is there anything I can add to If ucase(oFile.Name) = "word.lnk" Then
oFile.Delete True
that would accept what I need?

Thanks so much
hb101
 
Mark-

It seems that the lcase(oFile.Name) is only accepting lower case character and I should have realized this .. sorry. Can I add a conditional here to reflect upper case too?

Thanks again
hb101
 
Mark-

I figured it out... thank you so much for all your support.

hb101
 
Hi I am using this script and would like to change it to create html bookmarks/links instead of shortcuts. Is that possible?

set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop _
& "\Word.lnk")
oShellLink.TargetPath = _
"C:\Program Files\Microsoft Office\OFFICE11\winword.EXE"
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.IconLocation = _
"C:\Program Files\Microsoft Office\OFFICE11\winword.EXE, 0"
oShellLink.Description = "My word Shortcut"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save
 
Code:
SET fso = Wscript.CreateObject("Scripting.FileSystemObject")
SET WshShell = WScript.CreateObject("WScript.Shell")
strFavs = WshShell.SpecialFolders("Favorites")
strshortcut = strFavs & "\thespidersparlor.url"
If Not fso.FileExists(strshortcut) Then
	SET oUrlLink = WshShell.CreateShortcut(strshortcut)
	oUrlLink.TargetPath = "[URL unfurl="true"]http://www.thespidersparlor.com"[/URL]
	oUrlLink.Save
End If

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top