Jun 19, 2022 11:05 AM
(This post was last modified: Jun 19, 2022 11:20 AM by Hackoo.)
Hi 😋
I made a subroutine in order to create a shortcut for the current vbscript or any other application with arguments using an array that can be called as follow :
OR
OR
Run_As_Admin_Create_Shortcut.vbs
Run_As_Admin_Create_Shortcut.vbs (Click to View)
I made a subroutine in order to create a shortcut for the current vbscript or any other application with arguments using an array that can be called as follow :
- Example 1 : Create a shortcut to the current vbscript on the Desktop
Code
Create_Shortcut Array("Desktop","ShortcutName",WScript.ScriptFullName)OR
- Example 2 : Create a shortcut to the current vbscript on the User Startup Folder
Code
Create_Shortcut Array("Startup","ShortcutName",WScript.ScriptFullName)OR
- Example 3 : Create a shortcut for Network Diagnostics with arguments to fix connections problems on Desktop
Code
'Create_Shortcut Array(_
' "Desktop",_ '<=== "Desktop" folder and you can change it to "Startup" folder if you want
' "NetworkDiagnostics",_ '<=== ShortcutName
' "%SystemRoot%\system32\msdt.exe",_ '<=== Executable Target Path
' "-skip TRUE -path %Windir%\diagnostics\system\networking -ep NetworkDiagnosticsPNI",_ ' <==== Argument to pass for the executable
' "%SystemRoot%\system32\msdt.exe,0",_ ' <=== Icon Location
' "Network Diagnostics to fix connections problems",_ ' <=== Description of our Shortcut
' "CTRL+ALT+D"_ ' <=== Set a HotKey
')Run_As_Admin_Create_Shortcut.vbs
Run_As_Admin_Create_Shortcut.vbs (Click to View)

