- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to zip files in a folder using Windows 10. In Windows 7, I just created a vb script and used the built in zipping function. Windows 10, however, doesn't have that, so we have to use a 3rd party zipping software.
My code looks like this:
(setq batFileName (strcat (ReplaceSlash sourceFolder) dwgNumber ".bat")) (setq batFile (open batFileName "w")) (princ (strcat "\"C:/Program Files/7-Zip/7z.exe\" a \"" (ReplaceSlash zipFileName) "\" \"" (ReplaceSlash sourceFolder) "zipped/*\"" ) batFile) (close batFile) (command "shell" batFileName)
This gets me a .bat file with the one line:
"C:/Program Files/7-Zip/7z.exe" a "C:/UA_TEST/Unit Array Test/1234567GB0A.zip" "C:/UA_TEST/Unit Array Test/zipped/*"
When it does the shell command, I can see the DOS window show up for a second, then disappear, doing nothing.
If I double pick the batch file, it runs and zips all the files within the folder called "zipped" into a zip file called 1234567GB0A.zip.
So the batch file that gets created will work, but just not from the shell command.
I also tried to just use a command, like this:
(setq runZip (strcat "\"C:/Program Files/7-Zip/7z.exe\" a \"" (ReplaceSlash zipFileName) "\" \"" (ReplaceSlash sourceFolder) "zipped/*\"" )) (command "shell" runZip)
It also pops up the DOS window, but does nothing.
Thanks in advance for any help with this.
Mark
Solved! Go to Solution.