Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default How to CopyFolder to a readonly Folder? Help???

My problem: I'd like to transfer some custom Files for our program to work on
site,
to the local Documents and settings folder of the individual computer user,
I'd like to avoid having to program in copy each and every file to the
location and use a copy folder command of some sort in VBA.

On-line I read that the CopyFolder function can't work on a read-only folder..
and it appears that the Application data folder is readonly...

And Ideas here....


I was using code:

AppData = (Environ("AppData")) & "\Autodesk\AutoCAD 2007\R17.0\enu"

FromPath2 = "M:\SETUP_USER\ApplicationData"
ToPath2 = AppData 'my variable for

'If M:Drive Isn't Working Contact IT
If FSO.FolderExists(FromPath2) = False Then
MsgBox FromPath2 & " doesn't exist" & " Contact IT"
End If

'Copy Folder Fresh
FSO.CopyFolder FromPath2, ToPath2, False

Exit Sub

excerpt from:
http://www.devguru.com/technologies/...opyfolder.html

The overwrite parameter is a Boolean. True allows the overwriting of
existing files in the destination, providing that the permissions on the
destination allow it ( if the destination is set as read-only, the CopyFolder
method will fail). An overwrite setting of False prevents existing files in
the destination from being overwritten.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default How to CopyFolder to a readonly Folder? Help???

User = environ("USERPROFILE")
FromPath2 = User & "\ApplicationData"

to see all the environmental parameters on your system do the following

1) go to Start button and select RUN
2) In RUN box type : cmd.exe
3) In DOS window type : SET

On VISTA
1) go to Start button
2) Search for CMD.EXE which willopen the DOS window

"Benjamin" wrote:

My problem: I'd like to transfer some custom Files for our program to work on
site,
to the local Documents and settings folder of the individual computer user,
I'd like to avoid having to program in copy each and every file to the
location and use a copy folder command of some sort in VBA.

On-line I read that the CopyFolder function can't work on a read-only folder..
and it appears that the Application data folder is readonly...

And Ideas here....


I was using code:

AppData = (Environ("AppData")) & "\Autodesk\AutoCAD 2007\R17.0\enu"

FromPath2 = "M:\SETUP_USER\ApplicationData"
ToPath2 = AppData 'my variable for

'If M:Drive Isn't Working Contact IT
If FSO.FolderExists(FromPath2) = False Then
MsgBox FromPath2 & " doesn't exist" & " Contact IT"
End If

'Copy Folder Fresh
FSO.CopyFolder FromPath2, ToPath2, False

Exit Sub

excerpt from:
http://www.devguru.com/technologies/...opyfolder.html

The overwrite parameter is a Boolean. True allows the overwriting of
existing files in the destination, providing that the permissions on the
destination allow it ( if the destination is set as read-only, the CopyFolder
method will fail). An overwrite setting of False prevents existing files in
the destination from being overwritten.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CopyFolder Permission Denied, but who by? DartGuru Excel Programming 0 April 27th 07 09:05 AM
Force a Readonly Workbook to save to a different folder Charlotte Howard Excel Discussion (Misc queries) 6 August 23rd 06 04:41 PM
Copyfolder Andibevan[_2_] Excel Programming 1 May 18th 05 02:31 PM
Copyfolder Alvin Hansen[_2_] Excel Programming 4 February 24th 05 04:22 AM
CopyFolder Neil[_6_] Excel Programming 4 July 11th 03 04:57 PM


All times are GMT +1. The time now is 08:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"