|
-
Aug 25th, 2009, 10:32 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] "Permission Denied" when copy folder
vb Code:
Private Sub CopyFile()
Dim fsObject As FileSystemObject
Set fsObject = New FileSystemObject
fsObject.CopyFolder "\\serverName\SPPS\pKCb\Reports", "c:\SPPS\pKCb\", True
Set fsObject = Nothing
End Sub
Hi All,
Above is my code that hitting error when I'm trying to copy over one of the folder from server to client PC. The error message is "Permission Denied (70)"
Anyone can guide me to resolve my problem?
Thanks a million.
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Aug 26th, 2009, 12:05 AM
#2
Re: "Permission Denied" when copy folder
Are you able to manually copy that folder using Windows explorer?
-
Aug 26th, 2009, 01:32 AM
#3
Thread Starter
Hyperactive Member
Re: "Permission Denied" when copy folder
 Originally Posted by DigiRev
Are you able to manually copy that folder using Windows explorer?
Yes, I had tried it.
is it system ask permission to overwrite the file encountered permission issue?
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Aug 26th, 2009, 02:04 AM
#4
Re: "Permission Denied" when copy folder
Yes you don't have permissions to write to "c:\SPPS\pKCb\" but I wouldn't be surprised if you create a folder on your desktop and supply that path as the destination folder. Sometimes only the Desktop is left unlocked... like in my company
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Aug 26th, 2009, 08:03 PM
#5
Thread Starter
Hyperactive Member
Re: "Permission Denied" when copy folder
 Originally Posted by koolsid
Yes you don't have permissions to write to "c:\SPPS\pKCb\" but I wouldn't be surprised if you create a folder on your desktop and supply that path as the destination folder. Sometimes only the Desktop is left unlocked... like in my company 
I think lock is not the issue in my situation because I still can overwrite the file once I was clicked on Yes button hehe....
Any suggestion or solution to resolve my problem
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Aug 27th, 2009, 06:51 AM
#6
Re: "Permission Denied" when copy folder
How about deleting everything in the folder before making a new copy of it?
-
Aug 27th, 2009, 07:46 AM
#7
Re: "Permission Denied" when copy folder
You could solve this by two ways. One thing is this
1.Check that the folder exits or not using FolderExists Method.If exist delete it and copy it.
2. Or use the overwrite attribute to true
object.CopyFolder ( source, destination[, overwrite] );
Refer : MSDN
Please mark you thread resolved using the Thread Tools as shown
-
Aug 27th, 2009, 08:34 PM
#8
Thread Starter
Hyperactive Member
Re: "Permission Denied" when copy folder
Thanks Hack and danasegarane,
The problem was rectified by checking folder exist. If folder exist then delete the folder and making the new copy of it.
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|