(vl-mkdir "c:\\CAD-TOOLS")
(setq filename (getfiled "Select the File \"Cad tools 12-09-2023\"" "" "ZIP" 16))
; unzip
(startapp (strcat "powershell -command Expand-Archive -Path '" filename "' -DestinationPath 'C:/CAD-TOOLS' -FORCE"))
(alert "programs unzipped to C:/VFT-CAD-TOOLS")
I need to create a zip file for any files no create only one file.
I used (setq fso (vlax-create-object "Scripting.FileSystemObject")) to doit
But in windows 11 is not running. (i thinks so)
I try to use PowerShell with this command
(startapp "powershell.exe" (strcat "-Command Compress-Archive -path " filename " -Update -DestinationPath "fileZIP " -CompressionLevel Fastest"))
But in any computers does not run. I think that is the Execution police is restricted
But command Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
I try to create a ps1 file whit instructions but PowerShell said
No se puede cargar el archivo ps1 porque la ejecuci󮠤e scripts está deshabilitada en este sistema. Para obtener más informaci󮬠consulta el tema
about_Execution_Policies en https:/go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess
Anyone knows a simple version to create zip file.
The command must be executed in three party computer. I wouldn't like to force you to install 7zip or any other software
(setq filename "D:/acadtemp/*.lsp" filezip "D:/acadtemp/lispzip.zip")
(startapp (strcat "powershell -Command Compress-Archive -path '" filename "' -Update -DestinationPath '" fileZIP "' -CompressionLevel Fastest"))
Thaks Bigal
Another question
if I need to zip diferent files how do it?
Example:
File1.ddy file1.da1 file1.par
All in the same Folder.
into file1.zip
and rename to
File1.mex
Thanks again
But other colegues said that it not work in their computers, and i dont know why.Have you added the vldcl-AssToZip function to the other pc's?
Hi kosmos,It seemed the empty ZIP is created. If you can directly drag files into the empty ZIP file, the program should also be able to do it. However, I will suggest you to test the source code on the not-working PC to find out which line of code failed.
yes, i create a .fas file with all funcions.
Create a empty zip file but i dont know why.
In my computer works fine.
(setq filename (strcat (chr 39) "D:/acadtemp/test.lsp" (chr 39) ", " (chr 39) "D:/acadtemp/mypdfs.scr" (chr 39)) filezip "D:/acadtemp/lispzip.zip")
(setq fo (open (setq fname "D:\\acadtemp\\alan.bat") "w"))
(write-line (strcat "powershell -Command Compress-Archive -path " filename " -Update -DestinationPath '" fileZIP "' -CompressionLevel Fastest") fo)
(close fo)
(startapp "D:\\acadtemp\\alan.bat")