|
Create Desktop URL Shortcut |
|
|
|
Written by Carlton Colter
|
|
Thursday, 29 July 2004 00:00 |
|
Create's a desktop URL Shortcut to a specified location. This script can be useful as a logon script.
Script Code:
' *****************************************************
' * Copy url shortcut to desktop
' *****************************************************
CONST URLFILENAME = "www.carltoncolter.com.url"
CONST URL = "http://www.carltoncolter.com/"
CONST ICONINDEX = "13"
CONST ICON = "C:\WINDOWS\SYSTEM32\SHELL32.DLL"
Dim WS, FS, FilePath, DesktopPath, TheFile, OutStream
' Set scripting objects
Set WS = WScript.CreateObject("WScript.Shell")
set FS = CreateObject ("Scripting.FileSystemObject")
' Read desktop path using WshSpecialFolders object
DesktopPath = WS.SpecialFolders("Desktop")
FilePath = DesktopPath & "\" & URLFILENAME
' Check to see if file exists - if it does, delete it.
If FS.FileExists(FilePath) = False then
Set OutStream = FS.OpenTextFile(FilePath, 2, True)
OutStream.WriteLine "[InternetShortcut]"
OutStream.WriteLine "URL=" & URL
OutStream.WriteLine "IconIndex=" & ICONINDEX
OutStream.WriteLine "IconFile=" & ICON
OutStream.Close
End If
|
|
Last Updated ( Sunday, 06 July 2008 03:27 )
|
0 Comments