Advertisement
Guest User

Untitled

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