Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Ветеран


Сообщения: 27449
Благодарности: 8088

Профиль | Отправить PM | Цитировать


На WSH:
Скрытый текст
Код: Выделить весь код
Option Explicit

Dim strSourceFile

Dim objFSO


strSourceFile = "c:\Windows\Notepad.exe"

Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")

If objFSO.FileExists(strSourceFile) Then
	With WScript.CreateObject("WScript.Shell")
		With .CreateShortcut(objFSO.BuildPath(.SpecialFolders("AllUsersStartup"), objFSO.GetBaseName(strSourceFile) & ".lnk"))
			.TargetPath = strSourceFile
			.WorkingDirectory = objFSO.GetParentFolderName(strSourceFile)
			
			.Save
		End With
	End With
Else
	WScript.Echo "Source file [" & strSourceFile & "] not found."
	WScript.Quit 1
End If

Set objFSO = Nothing

WScript.Quit 0
Это сообщение посчитали полезным следующие участники:

Отправлено: 18:02, 27-10-2017 | #4