Need Help, zip_add

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
edyyus
Posts: 48
Joined: 16 May 2014 11:14

Need Help, zip_add

Post by edyyus »

Need Help, zip_add commad, I get many times alert message when zip folder with zip_add commad
Zip alert message.png

zip_add(zipfile, itemlist, [separator="|"])

"itemlist" i use folder path, like some file missing in foder

How to solved this problem e.g miss seting in xyplorer or windows, I use win 7

or to skip this message?
To see the attached files, you need to log into the forum.

highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Need Help, zip_add

Post by highend »

Show the full script / command that you're using

and: Does your user account really have the necessary permissions?
One of my scripts helped you out? Please donate via Paypal

edyyus
Posts: 48
Joined: 16 May 2014 11:14

Re: Need Help, zip_add

Post by edyyus »

Thanks highend to respon

bellow script i use, and other script use zip_add commad to zip bulk folder get same problem

Code: Select all


"_ZipForBackupX"
  $Items =<selitems |>; $Sel=get("CountSelected"); $items=;
  //$Root=<curpath>; 
  //Setting("BackgroundFileOps", 1);
  foreach($j,$Items,|){
    if (exists("$j")==2){
      $fold=listfolder("$j",,0,|);

      zip_add($j." +x.zip","$fold");

      $items=$items.$j.|;
    }
  }
  $c="Are you sure you want to Delete |this  $Sel  items";
  $conf=confirm("$c||Yes       = Delete With Recycle Bin|No        = Delete Without Recycle Bin|Cencel = Abort Delete Files","|",1,3);
  if($conf==2){sub _Abort; }
  else{
//     $pa=x; $Op="delete"; sub "_OpFastCopy";
    delete $conf,0,"$items";

    }
 // $Temp="E:\!XYplorerData\Data[7]\xxx.xys";
 //  WriteFile("$Temp",$items,"o");
 //  open $Temp,w;
  end(1==1);


Now i try make script use winrar

Code: Select all


"_ZipForBackupX"
//  unset $Op,$pa,$items; perm $Op,$pa,$items;
  $emp="<xyscripts>\#bat\Empty Folder +x.zip.txt"; // just to make empty zip file
  $Items =<selitems |>; $Sel=get("CountSelected"); $items=; $cb=chr(34); // "
  $Root=<curpath>; $Dat=;
  $Type="Defult - ( 1/8 Folder Saiz ).$Sc|( 1/26 Folder Saiz ).$Sc - Like Small Folder saiz|( 1/18 Folder Saiz ).$Sc - Like Small Folder saiz|( 1/12 Folder Saiz ).$Sc - Like Small Folder saiz, video or software|( 1/8 Folder Saiz ).$Sc - Like Small Folder saiz, Video or Compressed Files|( 1/6 Folder Saiz ).$Sc - Like Video or Compressed Files|( 1/5 Folder Saiz ).$Sc - Like Video and Picture|( 1/4 Folder Saiz ).$Sc - Like Video and Picture|( 1/3 Folder Saiz ).$Sc - Like Picture and files|( 1/2 Folder Saiz ).$Sc - Like Picture and files|( 3/4 Folder Saiz ).$Sc  - To Many Small Files like txt|Not Use Waiting Times per Folder";
  $i=inputselect("Set Waiting Times per Folder in Milisecond<crlf>GB $Sc = 000000  /  MB $Sc = 000  /  KB $Sc = 0",$Type,,32+128,"0",700,450,"@iMenu.xys");
  if($i==0){status "Cencel ZIP Folder",,alert; end(1==1);}
  elseif($i==2){$i=26;}elseif($i==3){$i=18;}elseif($i==4){$i=12;}elseif($i==6){$i=6;
  }elseif($i==7){$i=5;}elseif($i==8){$i=4;}elseif($i==9){$i=3;}elseif($i==10){$i=2;
  }elseif($i==11){$i=1.32;}elseif($i==12){$i=x;}else{$i=8;}
//  $FastCopy="C:\Program Files\FastCopyx64\FastCopy.exe";
//  Openwith """$FastCopy"" /auto_close /cmd=delete";
  foreach($j,$Items,|){
    if (exists("$j")==2){ $Fn=gpc("$j","file"); $Zn=$j." +x.zip";
      $filelist=listfolder("$j",,0,"$cb $cb"); 
      if($filelist!=""){run """C:\Program Files\WinRAR\WinRAR.exe"" a -ep1 -ts -afzip -ibck -- ""$Zn"" ""$filelist""";
      $fsaiz=foldersize("$j","<b>");
      $Unit=regexreplace($fsaiz,"((\d|,)+)( |\.\d+ )(\w+)",$4);
      if($Unit=="GB"){$Sc=000000;}elseif($Unit=="MB"){$Sc=000;}elseif($Unit=="KB"){$Sc=0;}else{$Sc=;}
      if($i==x){ $milis=1;
      }else{$milis1=regexreplace($fsaiz,"((\d|,)+)( |\.\d+ )(\w+)",$1).$Sc;
        $milis1=replace($milis1,",","");
        $milis2=eval($milis1 / $i);
        $milis=floor($milis2);
      }
      $Dat=$Dat.$fsaiz~$Unit~$Sc~$i~$milis1~$milis2~$milis~$j.<crlf>;
      if($milis<1){$milis=1;}
      status "Wait = $milis, ZIP folder $Fn , saiz = $fsaiz",BF0000,progress;
      wait $milis;
      }else{zip_add("$Zn","$emp");}
      $items=$items.$j.|;
    }else{status "Not Folder selected",,alert;}
  }
  $Temp="E:\!XYplorerData\Data[7]\+x.zip log.xys";
  WriteFile("$Temp",$Dat.<crlf>,"a");
//   open $Temp,w;
  end(1==1);
and i get problem to make winrar zip folder one by one(not paralel)
i try to control winrar with count folder saiz
any sugestion to make winrar not runing paralel,
like winrar commad line or xyplorer script

Sory, my english not so good
Last edited by edyyus on 29 May 2016 16:36, edited 1 time in total.

highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Need Help, zip_add

Post by highend »

You didn't answer the question if your user account has the necessary permissions for all files / folders...

And to not use waiting times (you don't need to), use e.g.:

Code: Select all

run """C:\Program Files\WinRAR\WinRAR.exe"" a -ep1 -ts -afzip -ibck -- ""$Zn"" ""$filelist""", <curpath>, 1;
or 2 instead of 1 if you don't want to see the shell message

Your regexreplaces are overly complicated btw.

Like:

Code: Select all

$Unit=regexreplace($fsaiz,"((\d|,)+)( |\.\d+ )(\w+)",$4);

Code: Select all

$Unit=regexreplace($fsaiz, "[^A-Z]+");
One of my scripts helped you out? Please donate via Paypal

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Need Help, zip_add

Post by LittleBiG »

This has nothing to do with permissions. It is an old bug which has never been solved, here is the topic I opened long long time ago: http://www.xyplorer.com/xyfc/viewtopic.php?f=2&t=9862 and posted the problem to here too: http://www.xyplorer.com/xyfc/viewtopic. ... 180#p96415 I had to stop using the internal zip solution in the end. :-(

highend
Posts: 14996
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Need Help, zip_add

Post by highend »

So the solution in that thread was:

Code: Select all

Setting "BackgroundFileOps", 0;
before the zip_add is used...
One of my scripts helped you out? Please donate via Paypal

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Need Help, zip_add

Post by LittleBiG »

highend wrote:So the solution in that thread was:

Code: Select all

Setting "BackgroundFileOps", 0;
before the zip_add is used...
Unfortunately this command doesn't switch off the background file operations to me. I had to do it manually in the configurations. And yes, I remembered well, it didn't solve the issue, I have just tried again.

edyyus
Posts: 48
Joined: 16 May 2014 11:14

Re: Need Help, zip_add

Post by edyyus »

You didn't answer the question if your user account has the necessary permissions for all files / folders...
Sory, miss answer, Yes i user account and can permissions for all files / folders, and i run xyplorer as administrator
And to not use waiting times (you don't need to), use e.g.:

Code: Select all

run """C:\Program Files\WinRAR\WinRAR.exe"" a -ep1 -ts -afzip -ibck -- ""$Zn"" ""$filelist""", <curpath>, 1;
or 2 instead of 1 if you don't want to see the shell message
Thanks, i try using,
Your regexreplaces are overly complicated btw.
Like:

Code: Select all

$Unit=regexreplace($fsaiz, "[^A-Z]+");
I very newbie and just learning regex and script in other forumer script(make sample)
LittleBiG wrote:
highend wrote:So the solution in that thread was:

Code: Select all

Setting "BackgroundFileOps", 0;
before the zip_add is used...
Unfortunately this command doesn't switch off the background file operations to me. I had to do it manually in the configurations. And yes, I remembered well, it didn't solve the issue, I have just tried again.
i like to using and learn more about WinRAR commad

Thanks highend & LittleBiG for info

Post Reply