Цитата Iwest:
А как то проверку выполнения можно сделать, чтобы узнать в чем проблема? »
|
Ну, сделайте:
Код:
![Выделить весь код](images/misc/selectcode.png)
Option Explicit
Dim strFile
Dim strPath
With WScript.CreateObject("Scripting.FileSystemObject")
For Each strFile In Array("1.txt", "App.bk")
strPath = .GetAbsolutePathName(.BuildPath(WScript.CreateObject("Shell.Application").NameSpace("shell:Common Documents").self.Path, "..\Replica\New\" & strFile))
If .FileExists(strPath) Then
With .GetFile(strPath)
If Not .Attributes And 1 Then
.Attributes = .Attributes Or 1
End If
End With
Else
WScript.Echo "File [" & strPath & "] not found."
End If
Next
End With
WScript.Quit 0