473,399 Members | 3,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Problems Deleting a File

I am trying to delete a excel file after it has been validated for
errors and then put into another folder for processing. My problem is,
when I click on the submit button, the excel file is being put into
the correct folder, but I am getting a permission denied error on my
file2 delete statement below. But if I hit the refresh button, the
file gets deleted the way I want it to. What do I need to do to stop
the permission denied error? Following is the code I am using to
delete the files:

function deleteStoreTempFiles()
{

var file2;
var file3;

file2 = fso.GetFile(storefolder + filename1);
file3 = fso.GetFile(tempfolder + "tmp_" + filename1);
file2.Delete();
file3.Delete();

}

TIA for any help anyone can give me!

Mike
Jul 20 '05 #1
1 3718
it looks like your problem has more to do with jscript or the
FileSystemObject than javascript. probably better to ask in
microsoft.public.activex.programming.scripting.jsc ript
"Mike" <wo***********@yahoo.com> wrote in message
news:2e**************************@posting.google.c om...
I am trying to delete a excel file after it has been validated for
errors and then put into another folder for processing. My problem is,
when I click on the submit button, the excel file is being put into
the correct folder, but I am getting a permission denied error on my
file2 delete statement below. But if I hit the refresh button, the
file gets deleted the way I want it to. What do I need to do to stop
the permission denied error? Following is the code I am using to
delete the files:

function deleteStoreTempFiles()
{

var file2;
var file3;

file2 = fso.GetFile(storefolder + filename1);
file3 = fso.GetFile(tempfolder + "tmp_" + filename1);
file2.Delete();
file3.Delete();

}

TIA for any help anyone can give me!

Mike

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John Caruthers | last post by:
HELP! This problem is driving me crazy. All other web sites that are being served out through this server are working, including sites and virtual directories that are under the Default Web...
2
by: uv | last post by:
Hi! I'm having problems submitting a new record through the form. I'm working with the wizard and I've added a control button to my form for entering entering a new record but for some reason it...
2
by: GMK | last post by:
Dear all in my asp.net application i have a text file that is installed with my application on the server. this text file is filled with data through a web interface in my application. i need to...
8
by: shandra | last post by:
I have a file I need to delete or truncate. I tried using the KILL command in VB6. I tried using the file.delete command in VB.net. I tried manually deleting, renaming, and copying over the...
6
by: Don | last post by:
I'm having problems working with a streamwriter object. After closing the streamwriter and setting it to Nothing, I try to delete the file it was writing to, but I always get the following error...
2
by: SiouxieQ | last post by:
Hi there, I'm using the code below to try to delete a name from a list of names in a file. Unfortunately it doesn't quite do what I want it to. Instead of looking for the name in the...
0
by: Sonnich | last post by:
Hi all! I seem to still have problems with MySQL. I wanted to create a new instance in order to run some tests of DB sizes. I want to create a new db, user etc... using teh command line client...
1
by: electrixnow | last post by:
Help!, I need to compile this code with static libs so it run on another XP machine that does'nt have MS Studio installed. When I compile now I get an ERROR: 1>------ Rebuild All started:...
0
by: myoungbl | last post by:
Note:I'm using VB.NET, .NET 2.0, to write a service application. So far I've only attempted to run it on the development machine. I'm have a couple of problems I can't quite figure out with a...
3
by: Kimera.Kimera | last post by:
I'm trying to write a program in VB.net 2003 that basically deletes all files, folders, sub-folders and sub-sub folders (etc). The program is simply for deleting the Windows/Temp folder contents,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.