{"id":1304,"date":"2021-01-17T19:46:51","date_gmt":"2021-01-17T08:46:51","guid":{"rendered":"https:\/\/4it.com.au\/kb\/?post_type=article&#038;p=1304"},"modified":"2022-12-01T19:49:24","modified_gmt":"2022-12-01T08:49:24","slug":"how-to-create-a-shortcut-to-a-windows-application-on-the-desktop-using-vbscript","status":"publish","type":"article","link":"https:\/\/4it.com.au\/kb\/article\/how-to-create-a-shortcut-to-a-windows-application-on-the-desktop-using-vbscript\/","title":{"rendered":"How to create a shortcut to a Windows application on the desktop using VBScript"},"content":{"rendered":"<p>Below is the script we use to create a shortcut to our portal in our RMM.\u00a0 This can be modified to suit your needs.<\/p>\n<pre>SET fso = Wscript.CreateObject(\"Scripting.FileSystemObject\")\r\nSET WshShell = WScript.CreateObject(\"<a class=\"linkified\" href=\"http:\/\/wscript.shell\/\" target=\"_blank\" rel=\"noopener nofollow\">WScript.Shell<\/a>\")\r\nWinDir = WshShell.ExpandEnvironmentStrings(\"%WinDir%\")\r\nstrDsk = \"C:\\Users\\Public\\Desktop\"\r\nstrshortcut = strDsk &amp; \"\\Portal.lnk\"\r\nIf Not fso.FileExists(strshortcut) Then\r\n\u00a0 \u00a0 SET oUrlLink = WshShell.CreateShortcut(strshortcut)\r\n\u00a0 \u00a0 oUrlLink.TargetPath = \"C:\\Program Files (x86)\\4IT Support Pty Ltd Support Portal\\ClientPortal.exe\"\r\n\u00a0 \u00a0 oUrlLink.IconLocation = \"C:\\Program Files (x86)\\4IT Support Pty Ltd Support Portal\\Icon.ico, 0\"\u00a0\r\n\u00a0 \u00a0oUrlLink.Save\r\nEnd If<\/pre>\n<p><em><strong>Please note: This is a \u201cQUICK SUPPORT\u201d article.<\/strong>\u00a0The information contained herein is provided as is. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. \u00a0More than likely specific steps may be missing and it could very well be assuming you have an advanced understanding on how to complete certain steps.<\/em><\/p>\n<div style='text-align:left' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>Below is the script we use to create a shortcut to our portal in our RMM.\u00a0 This can be modified to suit your needs. SET fso = Wscript.CreateObject(&#8220;Scripting.FileSystemObject&#8221;) SET WshShell = WScript.CreateObject(&#8220;WScript.Shell&#8221;) WinDir = WshShell.ExpandEnvironmentStrings(&#8220;%WinDir%&#8221;) strDsk = &#8220;C:\\Users\\Public\\Desktop&#8221; strshortcut = strDsk &amp; &#8220;\\Portal.lnk&#8221; If Not fso.FileExists(strshortcut) Then \u00a0 \u00a0 SET oUrlLink = WshShell.CreateShortcut(strshortcut) \u00a0 \u00a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","article-category":[9,838,841],"article-tag":[840],"class_list":["post-1304","article","type-article","status-publish","format-standard","hentry","article-category-windows-commands","article-category-quick-support-article","article-category-rmm-scripts","article-tag-desktop-shortcut-vbscript"],"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":4,"sum_votes":12},"_links":{"self":[{"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/article\/1304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/comments?post=1304"}],"version-history":[{"count":0,"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/article\/1304\/revisions"}],"wp:attachment":[{"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/media?parent=1304"}],"wp:term":[{"taxonomy":"article-category","embeddable":true,"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/article-category?post=1304"},{"taxonomy":"article-tag","embeddable":true,"href":"https:\/\/4it.com.au\/kb\/wp-json\/wp\/v2\/article-tag?post=1304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}