Link to home
Start Free TrialLog in
Avatar of arichexe
arichexe

asked on

datetime stamp

Utilizing wzzip, how would I write a script that plugs a system datetime stamp on the zip file name?

For example,

"c:\Program Files\WinZip\WZZIP.EXE" c:\docs<datetime stamp>.zip c:\*.doc

would produce:

c:\docs10-19-2004 03:00.zip
Avatar of msice
msice

For this you will need a .vbs WSH script like so it will create the zip file for you.

'VBScript

DIM fso, NewsFile, oFS
  var = cSTR(now())
  var = replace(var, "/" , "-" )
  var = replace(var, ":" , "_" )
  var = replace(var, "  " , "~" )
Set fso = CreateObject("Scripting.FileSystemObject")
Set NewsFile = fso.CreateTextFile("c:\docs"&var&".zip", True)
NewsFile.Close
ASKER CERTIFIED SOLUTION
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial