Hi,
to zip a single file I use this code:
dim dlg as new OpenDialog
dlg.InitialDirectory = SpecialFolder.Desktop
dim f as FolderItem = dlg.ShowModalWithin(self)
if f <> nil then
dim destination as string = f.Parent.Child("myArch.zip").ShellPath
dim s as new Shell
s.Execute "zip " + destination + " " + f.ShellPath
end if
The “myArch.zip” file gets created, but when I double-click it I find the deflated file buried into several nested folders.
For instance, if the original file (“myfile.doc”) is in a folder (“myFolder”) on the desktop, after zipping it and double-clicking the newly created myArch.zip file I get a folder with nested folders in this order:
users > carlorubini > desktop > myFolder > myfile.doc
So, how to zip a single fileso that the zipped archive contains the original file only?
Suggestions welcome. Thank you.