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 strongm 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
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
 
no reason to make it a Shortcut, you can make the real "special" Outlook icon that allows you to right click and access mail properties.

Code:
on error resume next

Dim path

Set WSHShell = CreateObject("WScript.Shell")

path = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{00020D75-0000-0000-C000-000000000046}\"
WSHShell.RegWrite path & "Removaltext","This is a special icon, do not delete","REG_SZ"
WshShell.AppActivate "Program Manager"
WshShell.SendKeys "{F5}"
If err then
	msgbox "Error Encountered" & Err.Description
else
	msgbox "Outlook Creation Sucessful"
End if

I hope you find this post helpful.

Regards,

Mark
 
I use the All Users Desktop directory for creating shortcuts. Something similar to whats below. Of course you can edit the directories to where ever you need them.

Function MakeDesktopShortcut( name, target )

Dim Shortcut, DesktopPath,StartupPath

DesktopPath = "C:\Documents and Settings\All Users\Desktop"

Set Shortcut = WSHShell.CreateShortcut(DesktopPath & "\" & name & ".lnk")

Shortcut.TargetPath = target

StartupPath = fs.GetParentFolderName( target )

If fs.FolderExists( StartupPath ) then

Shortcut.WorkingDirectory = StartupPath

End If

Shortcut.save
End Function
MakeDesktopShortcut "Outlook", "M:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE"

End If
 
Thanks guys-
Question:

My users are logging onto a Terminal Server where the Outlook is installed... I think Coremirror's would work better, right? We are using Folder Redirection for user's Desktop...

hers' what I have... Does this look right?

I use the All Users Desktop directory for creating shortcuts. Something similar to whats below. Of course you can edit the directories to where ever you need them.

Function MakeDesktopShortcut( name, target )

Dim Shortcut, DesktopPath,StartupPath

DesktopPath = "\\apxcluster\tsprofiles$\%username%\Desktop"

Set Shortcut = WSHShell.CreateShortcut(DesktopPath & "\" & name & ".lnk")

Shortcut.TargetPath = target

StartupPath = fs.GetParentFolderName( target )

If fs.FolderExists( StartupPath ) then

Shortcut.WorkingDirectory = StartupPath

End If

Shortcut.save
End Function
MakeDesktopShortcut "Outlook", "M:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE"

End If
 
I would disagree. Why create a shortcut when you can have the real icon which offers more functionality.

I hope you find this post helpful.

Regards,

Mark
 
Hey Mark-
I agree with you!
Here are my issues:

-My users are using WTS / Citrix published Desktop

-Their desktops are redirect (AD) to: \\apxcluster\tsprofiles$\%username%\Desktop

Here is where the target is:
"M:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE"

Start in:
"M:\Program Files\Microsoft Office\OFFICE11"


I got a long error when I tried yours.... I think I didn't have the parameters set right.
Can you help me given the path(s) above???

MANY MANY THANKS!!
Brandon


 
Take a look at the registry key referenced in the script. You may need to verify the permissions on the server with Regedt32 to ensure it can be written to.

I hope you find this post helpful.

Regards,

Mark
 
Any updates?

I hope you find this post helpful.

Regards,

Mark
 
Mark, don't suppose you have a script for the "special" Internet Explorer icon do you (right-click/Properties takes you to the Internet Properties screen)?

TIA

------------------------------------------------------------------------------------
"Life is like a box of chocolates, you never know what you're gonna get!"
------------------------------------------------------------------------------------
 
Thanks Guys-

I just finally created a .lnk and used a .bat file to copy it to user's desktop (using xcopy)...


Thanks!!

BRandon
 
But of course Lad
Code:
'creates a registry key and assigns it a value in the default value location.




on error resume next

Dim path

Set WSHShell = CreateObject("WScript.Shell")

 
path = "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\Namespace\{FBF23B42-E3F0-101B-8488-00AA003E56F8}\"
WSHShell.RegWrite path & "Removaltext","This is a special icon, do not delete","REG_SZ"
WshShell.AppActivate "Program Manager"
WshShell.SendKeys "{F5}"
If err then
	msgbox "Error Encountered" & Err.Description
else
	msgbox "IE Desktop Icon Creation Sucessful"
End if

I hope you find this post helpful.

Regards,

Mark
 
Mark, I tried the script and it creates the IE icon on the desktop, but if I double click on the icon or right click and select Properties, nothing happens. Also, the icon does not display the name underneath.

Any ideas?

------------------------------------------------------------------------------------
"Life is like a box of chocolates, you never know what you're gonna get!"
------------------------------------------------------------------------------------
 
Hmmm, what version of IE are you using? I wonder if the value has changed.

I hope you find this post helpful.

Regards,

Mark
 
Cheers Mark, the full IE version is: Internet Explorer 6.0.2900.2180.xpsp_sp2_gdr.050301-1519CO

------------------------------------------------------------------------------------
"Life is like a box of chocolates, you never know what you're gonna get!"
------------------------------------------------------------------------------------
 
i think it depends on what GUID that app has in the registry,
 
Hey- glad to see everyone responding...

THE LAD_
Care to start a NEW thread, please...

Thanks!
Brandon
 
Guys-

I had the same issue as bran2235.. users using Outlook 2000 where the app in installed on Windows2k server TS & Citrix MF XP FR3 installed.. I created a script as Markdmac suggested and it works great!

I now want to upgrade my Office 2000 installation to Office 2003 on the same servers.. this means I would need to wipe out their old icons(shortcuts to office) .. what can I add to my script in order to first delete any old office 2000 icons and then after that step is accomplished, the rest of my script would execute and do it's thing..

heres the script I use.. feel free to edit the script as needed in order to first delete icons before installing new ones:
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

thanks for any support
hb101
 
Hellboy, let the tools do the work for you. Use my FAQ to create an administrative install and push out Office 2003 via GPO. The icons will automatically get updated without further interaction on your part. This drastically simplifies your work for the deployment as well as updating the icons. faq96-4996

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Hi Mark-

I initially wanted to do that but here's the thing:

The upgrade to Office 2003 is being installed on Citrix server s (5 of them).. Users have "published desktops" thru Citrix where Office 2003 would be stored. I could'nt push office 2k3 thru a gpo because most of these users have thin client (Wyse terminals) specifically designed for access to Citrix published menus.

So all I truly need is help with my code that would first look for any existing "older" Office 2000 shortcuts.. delete them... and then follow the rest of my script from my previous post.. where it will create new shortcuts.. this script works pretty well, just don't know how to code for "deleting" older shortcuts..
thanks for all your help Mark, hoping you can help me with this alittle further.

hb101
 
Hi Marc-

I forgot to mention, that "best practice" from what I've read states that you first would need to completely remove Office 2000 from your Citrix servers (these run Windows 2000 SP$ and TServices just so you know).. then install Office 2003, but the users would still have older shortcuts pointing to different "Start in" and "target" paths.. As you probably know, Office 2k's installation path is different from Office 2k3.. this is why I'd need the script enhancement to remove old shortcut before applying new Outlook 2k3 ones..

thanks so much for all your support
hb101
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top