' ' ------------------------------------------------------------------------ ' Copyright (C) 2002 Marios Polyzoes. ' ------------------------------------------------------------------------ 'SN 020507 ' ******************************************************************************** Dim WSHShell, theFolder, fso, d, f, fc, s, nf, MyShortcut, MyDesktop, WinPath, TheCurrentUser Set WSHShell = WScript.CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") ' ******************************************************************************** ' This reads who is the current user TheCurrentUser = WshShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Logon User Name") ' Read from value "Val". ' ******************************************************************************** ' Welcome message L_Welcome_MsgBox_Message_Text = "This script will create The shortcut of Notepad in SendTo folder of the current user " & TheCurrentUser & Chr(13) & "When you right click on a file you can use the 'send to Notepad' to edit it." & Chr(13) & Chr(13) & "Questions and queries? marpolyz@hotmail. com" L_Welcome_MsgBox_Title_Text = "A script from Marios" Call Welcome() Set WinPath = fso.GetSpecialFolder(WindowsFolder) Set d = fso.GetDrive(fso.GetDriveName(WinPath)) s = d.DriveLetter ' Create the Notepad in send to folder Set MyShortcut = WSHShell.CreateShortcut(s & ":\Documents and Settings\" & TheCurrentUser & "\SendTo\Notepad.lnk") MyShortcut.TargetPath = WSHShell.ExpandEnvironmentStrings("%windir%\notepad.exe") MyShortcut.WorkingDirectory = WSHShell.ExpandEnvironmentStrings("%windir%") MyShortcut.WindowStyle = 4 MyShortcut.IconLocation = WSHShell.ExpandEnvironmentStrings(WinPath & "\notepad.exe, 0") MyShortcut.Save '------------------------- WScript.Echo "The work is done. Thank you " & TheCurrentUser & "!" ' ******************************************************************************** ' * ' * Welcome ' * Sub Welcome() Dim intDoIt intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _ vbOKCancel + vbInformation, _ L_Welcome_MsgBox_Title_Text ) If intDoIt = vbCancel Then WScript.Quit End If End Sub