Using ExecFile command with parameters. Possible?


👉 BlitzCoder will be building a new platform and other plans to preserve and continue the Blitz legacy.

To be able to achieve this goal, we need your support by becoming a Patreon Paid Member 👈

 

Tweet
RandallFlagg

Hi All,

I am trying to write a really simple piece of code that zips every file in a directory individually and places it into another directory.

I thought that using 7z.exe with some additional parameters added in the "ExecFile" command might do the job for the zipping part but while the program seems to execute ok, and the parameters I am using also seem to work fine if I emulate in command prompt, I'm not getting any files in my output directory.

My basic command for zipping the files is as follows:

                ExecFile ("7z.exe"+Chr$(134)+"a"+Chr$(134)+"-tzip"+Chr$(134)+destination_directory$+"\"+zipped_file_name$+Chr$(134)+source_directory$+"\"+original_file_name$)

Like I say, its running fine without any bugs reported but I'm not getting a zipped file in the output directory.

Any advice / help would be much appreciated.

RemiD commented:

maybe right click your executable (made with blitz3d) and 7zip.exe, and give them admin rights ?

RandallFlagg commented:

Thanks for the reply!

It turns out that I'm just a dipsh1t and chr$(134) isn't a space... its should be chr$(32), and I didn't need to use CHR$'s anyway...

I misread the explanation in Blitz3D and thought that spaces needed to be defined as chr$'s. This isn't the case anyway and also I used the wrong value.

Have got it working perfectly now although there is a lot of cases of 7zip running in parallel. Have had to slow the execution down by not converting the next file until evidence of the currently zipped file turns up in the destination directory as it was crashing my laptop and even then, there's about 10 lots of 7z running at once but works really well.

Reply To Topic (minimum 10 characters)

Please log in to reply