Differences
This shows you the differences between two versions of the page.
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. | ||
- | < | ||
- | ' | ||
- | ' VBScript: | ||
- | ' NAME: < | ||
- | ' DESCRIPTION: | ||
- | ' | ||
- | |||
- | ' | ||
- | Option Explicit | ||
- | Const OverwriteExisting = TRUE | ||
- | Dim IconName | ||
- | Dim CopyFrom | ||
- | Dim CopyTo | ||
- | Dim objIcon | ||
- | |||
- | ' | ||
- | |||
- | ' | ||
- | IconName = " | ||
- | |||
- | 'Full network path of folder icon is in. (include trailing slash) | ||
- | CopyFrom = " | ||
- | |||
- | 'Full local directory to copy the icon to | ||
- | CopyTo = " | ||
- | |||
- | ' | ||
- | |||
- | Set objIcon = CreateObject(" | ||
- | |||
- | If objIcon.FileExists(CopyTo & IconName) Then | ||
- | Wscript.Quit | ||
- | Else | ||
- | ObjIcon.CopyFile CopyFrom & IconName , CopyTo, OverwriteExisting | ||
- | End If | ||
- | </ |