Run time error 70: Permission denied

Dear Experts:

i have a VB program it will perform create txt file and copy image file function using filesystem object.
however the program will show me the following error message:

 "Run-time error '70'

 Permission denied"

i had checked all the files and folders, they are not read only.
and i logon as admin with full control of the machine.

what could be the cause of this problem and the solution?
Thanks in advance for helping me to solve this problem.
wolveringAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Valliappan ANConnect With a Mentor Senior Tech ConsultantCommented:
Check if you have something to do with Scripting Access. Hope your system can control if Windows Scripting is allowed or not. Since, FSO needs Windows Scripting to be in Windows, to run through.

If you'd like to look at:
http://www.sarc.com/avcenter/venc/data/win.script.hosting.html

Cheers
0
 
nahumdCommented:
Which line causes the error ?
0
 
wolveringAuthor Commented:
not sure,i run the exe file in NT.  I think it is the WinNT configuration problem.  what setting could cause this error to occur? as i run the program smoothly in win98.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
nahumdCommented:
Try to create this file manually in the destination directory and see it you can do it.

0
 
wolveringAuthor Commented:
Yes i can create files or folder manually
0
 
nahumdCommented:
Well first we must identify the line code that caused the error.
You can either install vb there, or use error handling in your code to identify it, or try to remove the suspected offending line and see if it removes the error.
0
 
wolveringAuthor Commented:
i am sure it is not the problem of program code because i tested the program in different OS.  this problem happen only in that particular machine with NT installed.
so i am quite sure it is the NT setting problem instead of program code.
0
 
sweetpillowCommented:
Hi,

   Here is the reason why this error come out :

You tried to write to a write-protected disk, to access a locked file, or to use UNLOCK on a file that was not locked.

POSSIBLE SOLUTIONS:

Remove write-protection from the disk.

Unlock the file before attempting access.

Lock the file before trying to unlock it.

Remove the UNLOCK statement.

Insert error checking to test for disk/file status before attempting WRITE or UNLOCK operations.

Cheers,
Sweetpillow :)
0
 
GuruVBCommented:
Try using "Name" function from VB. Before you try make sure that you have closed the file.

I hope this will help you
0
 
RainUKCommented:
Are you using APIs to access the file?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.