The Windows Scripting Host
FIGURE 2
Continued from Figure 1: Mapping Network Drives
This script reads URLs from a text file and creates URL shortcuts on the desktop.
Dim WshShell, WshUrlShortcut
Dim fs, listFile
Dim urlString, nameString, desktopFolder
Set fs = WScript.CreateObject(" Scripting.FileSystemObject")
Set listFile = fs.OpenTextFile("c:\wsh\url.txt")
Set WshShell = WScript.CreateObject("WScript.Shell")
desktopFolder = WshShell.SpecialFolders("Desktop")
Do While listFile.AtEndOfStream <> True
nameString = listFile.ReadLine
urlString = listFile.ReadLine
Set WshUrlShortcut = WshShell.CreateShortcut(desktopFolder &
"\" & nameString & ".url")
WshUrlShortcut.TargetPath = urlString
WshUrlShortcut.Save
Loop
listFile.Close
Published as Operating Systems in the 02/10/98 issue of PC Magazine.