Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

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

Ветеран


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

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


Код: Выделить весь код
Option Explicit

Dim strFileName
Dim strSourceFile
Dim strDestFolder


strFileName   = "Setup.exe"

With WScript.CreateObject("Scripting.FileSystemObject")
	strSourceFile = .BuildPath(.GetParentFolderName(WScript.ScriptFullName), strFileName)
	strDestFolder = .BuildPath(WScript.CreateObject("Shell.Application").NameSpace("shell:appdata").self.Path, "My First Program")
	
	If .FileExists(strSourceFile) Then
		If .FolderExists(strDestFolder) Then
			.CopyFile strSourceFile, strDestFolder & "\", True
			WScript.CreateObject("WScript.Shell").Run """" & .BuildPath(strDestFolder, strFileName) & """", 1, False
		Else
			WScript.Echo "Destination folder [" & strDestFolder & "] not found."
		End If
	Else
		WScript.Echo "Source file [" & strFile & "] not found."
	End If
End With

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

Отправлено: 00:05, 25-02-2013 | #2