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

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

Ветеран


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

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


Примерно так:
Код: Выделить весь код
Option Explicit

Dim strDestFileTemplate
Dim strDestFile


strDestFileTemplate = "\\Server\Share$\<MachineName>.txt"

With WScript.CreateObject("Scripting.FileSystemObject")
	strDestFile = Replace(strDestFileTemplate, "<MachineName>", WScript.CreateObject("WScript.Network").ComputerName)
	
	If .FolderExists(.GetParentFolderName(strDestFile)) Then
		If Not .FileExists(strDestFile) Then
			.CreateTextFile(strDestFile).Close
		Else
			WScript.Quit 2
		End If
	Else
		'WScript.Echo "Can't find destination folder [" & .GetParentFolderName(strDestFile) & "]."
		WScript.Quit 1
	End If
End With

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

Отправлено: 11:15, 28-11-2016 | #2