How to kill the zipped files in C:\Document and Settings\LogginName\Temp\ using code for this strang

Y

Yuvraj

Hi Guys,

I have a strange Problem with my code.

My code zips the file from File Server and then opens and reads it in
excel application.

The code then deletes the file in the Temp folder in the path given
above.

Initially we were using winzip but now we are using windows shell
programming where the code is

obj.Namespace(sourceFileName) Namespace(DestinationFilename).Items

Ideally this function needs to unzip the *.xls item in the Temp
folder.


Problem:

The above function using windows is also creating a Tempory Folder
inside Temp with New name and then

pasting the *.xls inside it.

Ideally when I am using

Kill "Temp/*.xls" I am not able to delete the zipped file.

this statement also creates a Temporary folder.

This was not happening when we were using winzip.


Please guys guide me to kill the zipped files without forming
temporary folder in the Temp directory.

Also Please send me the code to delete the folders including the all
the files in Temp folder.

Regards,

Prince
 
D

Dave Peterson

I don't use this (except when rummaging through Ron de Bruin's code!), but you
can use:

On error resume next
Kill "C:\somefolder\filename.zip"
on error goto 0

The "on error resume next" will hide any error caused by the file not being
there. (And it'll also hide the error caused by not being able to delete the
file.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top