Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VBScript
Hi Guys/Gals,
 
I have created this little script to copy the icon shortcut with url shortcut
that will install a shortcut to the specific website with a defined icon, on employees desktops. I'm currently using VBScript to create the shortcut. Below is the working code:
 
Set WshShell = CreateObject("WScript.Shell")
strDesktopPath = WshShell.SpecialFolders("Desktop")
Set objShortcutUrl = WshShell.CreateShortcut(strDesktopPath & "\Shortcut name goes here.lnk")
objShortcutUrl.TargetPath = "Web link goes here"
objShortcutUrl.IconLocation = "icon path goes here"
objShortcutUrl.Save
 
At the moment it does not give any confirmation if the shortcut has been copied onto the desktop, the script is working fine it does push the icon shortcut. But I am wondering if a prompt pops up saying "Icon copied or installed successfully etc." Can a line be added in the script for prompt popup??
 
I would appreciate any help please. Thanks in advance.
Posted 17-Aug-12 12:07pm
Edited 18-Aug-12 4:44am
v9
Comments
Wes Aday at 17-Aug-12 17:42pm
   
"Can a line be added in the script"... of course you can. I am going to out on a limb and assume that your real question is something like "How can I show a message box?" or something like that.... and the answer can be found here, http://www.databison.com/index.php/vba-message-box-msgbox-the-message-can-do-better/
Wes Aday at 17-Aug-12 18:34pm
   
What does "doesn't seems to be working" mean? Do you get the message box? It does not terminate?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
Espen Harlinn at 18-Aug-12 12:33pm
   
Nice link :-D
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I got this code which does the job.
x=msgbox("Your Text Here" ,0, "Your Title Here")
  Permalink  
Comments
Espen Harlinn at 18-Aug-12 12:33pm
   
5'ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 280
1 Jochen Arndt 150
2 Kornfeld Eliyahu Peter 120
3 PIEBALDconsult 110
4 Richard MacCutchan 105
0 OriginalGriff 6,055
1 DamithSL 4,621
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,500
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 18 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100