SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict Ramiro S's Avatar
    Join Date
    May 2003
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Small DOS question

    Since there is no DOS section... huh... how can a site like SitePoint miss this.....

    ..



    Just joking... I need something simple:

    Im zipping using the command line, how can I automaticaly add the date in the zip file?

    Thank you.
    Quasar - Web Development - Free Avatars

  2. #2

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ramiro S
    how can I automaticaly add the date in the zip file?

  3. #3
    SitePoint Addict Ramiro S's Avatar
    Join Date
    May 2003
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I run WinZip from the command line in Windows. Something like:

    c:\Progra~1\WinZip\WZZIP.exe -r -p THEZIPFILEHERE.ZIP c:\backupthis\

    that generates a zipfile named THEZIPFILEHERE.ZIP

    what do I need to add so the file name will be: THEZIPFILEHERE2004-03-19.ZIP
    Quasar - Web Development - Free Avatars

  4. #4
    SitePoint Guru SteveO's Avatar
    Join Date
    Jan 2003
    Posts
    625
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ramiro S
    I run WinZip from the command line in Windows. Something like:

    c:\Progra~1\WinZip\WZZIP.exe -r -p THEZIPFILEHERE.ZIP c:\backupthis\

    that generates a zipfile named THEZIPFILEHERE.ZIP

    what do I need to add so the file name will be: THEZIPFILEHERE2004-03-19.ZIP
    try this:
    Code:
         c:\Progra~1\WinZip\WZZIP.exe -r -p THEZIPFILEHERE.ZIP%date% c:\backupthis\
    Works in normal command screen:
    Code:
     C:\> echo %date%
      19/03/2004

  5. #5
    SitePoint Addict Ramiro S's Avatar
    Join Date
    May 2003
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ive tried that... but it shows something like filenameFRI.zip

    it only adds the FRI text
    Quasar - Web Development - Free Avatars

  6. #6

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The output of %date% is based on your regional settings. What does a echo %date% output?

  7. #7
    SitePoint Addict Ramiro S's Avatar
    Join Date
    May 2003
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got it... Windows use the long date format so its Fri 3-19-2004 thats why it was cutting the file (the space). Thanks for the input!
    Quasar - Web Development - Free Avatars

  8. #8
    Phil fillup07's Avatar
    Join Date
    May 2002
    Location
    Jacksonville, FL
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So did you have to change your Window's settings then?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •