windows_wiki:vbscript_-_icon_copy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

windows_wiki:vbscript_-_icon_copy [2014/11/18 23:22]
billdozor created
windows_wiki:vbscript_-_icon_copy [2019/05/25 23:50]
Line 1: Line 1:
-====== VBScript - Icon Copy ====== 
-Script template to copy an external icon for use in a shortcut. 
  
-<code> 
-'========================================================================== 
-' VBScript:  AUTHOR: <name> <date> 
-' NAME: <Template-ExtIcon.vbs> 
-' DESCRIPTION: Copies an External Icon to C:\ if it does not already exist.  
-'========================================================================== 
- 
-'Declare Variables for later use 
-Option Explicit 
-Const OverwriteExisting = TRUE 
-Dim IconName 
-Dim CopyFrom 
-Dim CopyTo 
-Dim objIcon 
- 
-'++++++++++++++++++++++++ EDIT THESE VARIABLES +++++++++++++++++++++++++++++ 
- 
-'Filename of Icon (include extension) 
-IconName = "Name.ico" 
- 
-'Full network path of folder icon is in. (include trailing slash) 
-CopyFrom = "\\server\folder\" 
- 
-'Full local directory to copy the icon to 
-CopyTo = "C:\" 
- 
-'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
- 
-Set objIcon = CreateObject("Scripting.FileSystemObject") 
- 
-If objIcon.FileExists(CopyTo & IconName) Then 
-  Wscript.Quit 
-Else 
-  ObjIcon.CopyFile CopyFrom & IconName , CopyTo, OverwriteExisting 
-End If 
-</code> 
  • windows_wiki/vbscript_-_icon_copy.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)