Сам код bat
Код:
Код: Выделить всё
@echo off
Set From="\\192.168.0.21\1$\2"
Set To="C:\3"
Set VerFile="C:\3\11.txt"
If Not Exist %VerFile% If Exist %To% xcopy %From% %To% /s /e /c /h /r /y /qКод: Выделить всё
@echo off
Set From="\\192.168.0.21\1$\2"
Set To="C:\3"
Set VerFile="C:\3\11.txt"
If Not Exist %VerFile% If Exist %To% xcopy %From% %To% /s /e /c /h /r /y /qКод: Выделить всё
BoxIn = "\\192.168.100.23\Test1\kuku"
BoxOut = "Z:\Soft_Out"
Flag = BoxOut + "\11.txt"
With CreateObject("Scripting.FileSystemObject")
If Not .FolderExists(BoxOut) Then
MsgBox "Folder" + vbCrLf + vbCrLf + BoxOut + vbCrLf + vbCrLf + "not found"
WScript.Quit 2
End If
If .FileExists(Flag) Then
MsgBox "File" + vbCrLf + vbCrLf + Flag + vbCrLf + vbCrLf + "exists."
WScript.Quit 1
End If
.CopyFolder BoxIn, BoxOut, True
End With
MsgBox "OK"Код: Выделить всё
C:\Users" & username & "\AppData\Код: Выделить всё
C:\Users" & username & "\AppData\Код: Выделить всё
BoxIn = "\\192.168.0.21\32$\2"
BoxOut1 = "C:\1"
BoxOutTerm = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%") + "\AppData" + "\1"
Flag1 = BoxOut1 + "\23.txt"
FlagTerm = BoxOutTerm + "\23.txt"
'*************************************************
With CreateObject("Scripting.FileSystemObject")
If Not .FolderExists(BoxOut1) Then
WScript.Quit 2
End If
If Not .FolderExists(BoxOutTerm) Then
WScript.Quit 2
End If
If .FileExists(Flag1) Then
End If
.CopyFolder BoxIn, BoxOut1, True
If .FileExists(FlagTerm) Then
End If
.CopyFolder BoxIn, BoxOutTerm, True
End With