computing
  • 0

Solved I Want To Zip The Files Using Vbs Script

  • 0

Can onyone please help me to zip the files using VB script ?

My requirement is like:

There will be two files in the folder C:\Users\MEDICARE\
File1 = MEDICARE_%CCYY%%MM%%DD%_CHANGE.txt
FIle2 = MEDICARE_%CCYY%%MM%%DD%_FULL.txt

CCYY = Current year like 2013
MM = Current month like 06
DD = Current date like 05

The above files come to this folder C:\Users\MEDICARE\ with current date.

The above files will not be there in the folder togethter. Some times MEDICARE_%CCYY%%MM%%DD%_CHANGE.txt will be there or some times MEDICARE_%CCYY%%MM%%DD%_FULL.txt

So we need to have if condition here, Whichever file is availbe we need to ZIP that file.

For eg..

If MEDICARE_%CCYY%%MM%%DD%_CHANGE.txt is availbe in C:\Users\MEDICARE\
Then we need to zip the file like C:\Users\MEDICARE\MEDICARE_%CCYY%%MM%%DD%_CHANGE.zip

If MEDICARE_%CCYY%%MM%%DD%_FULL.txt is availbe in C:\Users\MEDICARE\
Then we need to zip the file like C:\Users\MEDICARE\MEDICARE_%CCYY%%MM%%DD%_FULL.zip

Please help me to get this done in VB script

Share

1 Answer

  1. Replace “c:\vbs” with whatever folder you’re trying to enumerate. “C:\Users\MEDICARE”, I suspect.

    How To Ask Questions The Smart Way

    • 0