Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- set X=
- for /f "skip=1 delims=" %%x in ('wmic os get localdatetime') do if not defined X set X=%%x
- set DATE.YEAR=%X:~0,4%
- set DATE.MONTH=%X:~4,2%
- set DATE.DAY=%X:~6,2%
- set FILETOZIP=C:\Users\ferit\dosya\sonuclar.xls
- set HEDEF=D:\yedek
- copy %FILETOZIP% %HEDEF%
- echo Set objArgs = WScript.Arguments > _zipIt.vbs
- echo InputFile = objArgs(0) >> _zipIt.vbs
- echo ZipFile = objArgs(1) >> _zipIt.vbs
- echo CreateObject("Scripting.FileSystemObject").CreateTextFile(ZipFile, True).Write "PK" ^& Chr(5) ^& Chr(6) ^& String(18, vbNullChar) >> _zipIt.vbs
- echo Set objShell = CreateObject("Shell.Application") >> _zipIt.vbs
- echo objShell.NameSpace(ZipFile).CopyHere(InputFile) >> _zipIt.vbs
- echo wScript.Sleep 2000 >> _zipIt.vbs
- CScript _zipIt.vbs %HEDEF%\sonuclar.xls %HEDEF%\%DATE.YEAR%%DATE.DAY%%DATE.MONTH%.zip
- del _zipIt.vbs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement