Ветеран
Сообщения: 27449
Благодарности: 8087
|
Профиль
|
Отправить PM
| Цитировать
читать дальше »
Код: ![Выделить весь код](images/misc/selectcode.png)
Option Explicit
Const ForWriting = 2
Const ReadOnly = 1
Const Hidden = 2
Const System = 4
Dim strSourceFile
Dim lngAttributes
strSourceFile = "C:\Песочница\045\Rezult.txt"
With WScript.CreateObject("Scripting.FileSystemObject")
If .FileExists(strSourceFile) Then
With .GetFile(strSourceFile)
lngAttributes = .Attributes
.Attributes = lngAttributes And Not (ReadOnly + Hidden + System)
With .OpenAsTextStream(ForWriting)
.WriteLine Date()
.Close
End With
.Attributes = lngAttributes
End With
Else
With .CreateTextFile(strSourceFile)
.WriteLine Date()
.Close
End With
End If
End With
WScript.Quit 0
|
Отправлено: 17:08, 16-06-2014
| #2
|