0

I have a batch file that compresses files into a zip folder so I can email the file. The file runs with no issues. However, when I try to open the zip folder, I get the following error:

'Folder is invalid'

and it won't open. Below is the part of the step that compresses the file on Windows Server 2012:

COMPRESS "%DIR_IP_INTERFACES%\SP_Backups\Outbound_GDC_Req.txt" "%DIR_IP_INTERFACES%\SP_Backups\Outbound_GDC_Req_%DATE:/=%_%TIME::=%.zip"

I need it to zip during the batch file, but I will not be the one unzipping. So, I was looking for a standard way to allow anybody to open/unzip the folder when they receive the email (that doesn't require multiple downloads/changes on each computer that might open these files).

Any ideas?

double-beep
  • 5,031
  • 17
  • 33
  • 41
rbaskins
  • 11
  • 2
  • Check [this](https://stackoverflow.com/questions/28043589/how-can-i-compress-zip-and-uncompress-unzip-files-and-folders-with-bat) . – npocmaka Nov 26 '18 at 14:21
  • 1
    compress does not create a `zip` but a `cab` file – npocmaka Nov 26 '18 at 14:23
  • @npocmaka Thanks for the compress cab file info. I didn't know that. As for your link, the 2003 Admin Tool Pack doesn't work on 64 bit Server. Also, the ZIP.CMD and UNZIP.CMD links are no longer available – rbaskins Nov 26 '18 at 14:53
  • 1
    @rbaskins, strange. I use a lot of the tools in it on all my 64 bit servers and desktops. – Squashman Nov 26 '18 at 15:06
  • @Squashman It allows me to download it, but the zip.cmd still does not work. I think the issue isn't the 64 bit. After more looking, I believe it is because I am trying to run on a Server 2012 R2 – rbaskins Nov 26 '18 at 15:12
  • @rbaskins - probably zipjs.bat is the most portable way to zip your files. I'll have to update the info concerning Frank Westlake's scripts. – npocmaka Nov 26 '18 at 15:27
  • @rbaskins, the `Zip.cmd` has nothing to do with the Windows 2003 Admin Tools. – Squashman Nov 26 '18 at 15:35
  • @npocmaka Ok, I will look into trying that out. Thanks – rbaskins Nov 26 '18 at 16:13
  • @Squashman oh ok. So what would be the reason for zip.cmd returning that it is not a recognized internal/external command, operable program, or batch file? Do I need to provide access/permissions for it that I am unaware of? – rbaskins Nov 26 '18 at 16:14

0 Answers0