|
-
Jan 11th, 2005, 08:50 AM
#1
Thread Starter
Junior Member
Re: Code to copy a folder
Thanks Hack that works a charm, I now i pushing it but how would I change the folder security to give users write and modify access to the folder?
-
Jan 11th, 2005, 08:56 AM
#2
Re: Code to copy a folder
VB Code:
SetAttr "c:\myfolder\", vbNormal
-
Jan 11th, 2005, 09:15 AM
#3
Thread Starter
Junior Member
Re: Code to copy a folder
I have tried the above but the user folder permissions are still read only [we only give users read access to the C:\ we setup folders with write and modify if it is needed] any help will be appriciated.
In DOS you can change the CACLS on a folder:
source = c:\myfolder
cacls source /t /e /g users:c
would using the shell command be the best way around this? and how would I do this [I am new to VB]
-
Jan 11th, 2005, 09:21 AM
#4
Re: Code to copy a folder
SetAttr has always worked for me. How are you using it?
-
Jan 11th, 2005, 09:31 AM
#5
Thread Starter
Junior Member
Re: Code to copy a folder
I just added it to the end of your code tike this:
Private Sub cmdMakeItHappen_Click()
Dim fso As FileSystemObject
Dim target_folder As Folder
Dim Source = c:\myfolder
Set fso = New FileSystemObject
fso.CopyFolder "H:\MyFolder\", Source
MsgBox "I am done"
SetAttr Source, vbNormal
End Sub
-
Jan 11th, 2005, 09:35 AM
#6
Re: Code to copy a folder
You are getting a little ahead of yourself.
Modify your code ever so slightly as follows:
VB Code:
'not
Dim Source = c:\myfolder
'but
Dim Source As String
Source = "C:\myfolder"
Then try it.
-
Jan 11th, 2005, 09:51 AM
#7
Thread Starter
Junior Member
Re: Code to copy a folder
Its still not working, where does SetAttr Source, vbNormal get its permissons from? if it looks at the root directory in this case [C:\] then it will keep them as read only. I am not permitted to alter the permission of the directory as a whole only folders which need write and modify can be changed [the domain admins stop me from doing this]
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
|