Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Folder Permissions and Folder Creation

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,62244
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Folder Permissions and Folder Creation
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Folder Permissions and Folder Creation - 7/9/2008 12:02:06 AM   
  zagadka

 

Posts: 4
Score: 0
Joined: 2/14/2008
Status: offline
I'm a bit of a newb to VBScript and have pretty much copied scripts from various sites and chopped and changed them until they work, I'm not really sure what all the commands do at this time, so please bear with me.....


      

Here is a script I use to copy BGInfo files off of the server which are place onto a users computer. THe script then takes the shortcut and places it in the All Users Startup folder (this may not be the best way, but it works!)

We have recently had a couple of users discover that it is easy to go in and change the wallpaper image in BGinfo to thier own. To combat this, on the users who do it, I have manually gone to the BGInfo folder and set the Special Permissions so that the user is denied access to delete and modify the contained files and folders which has worked.

I'd like to be able to do this to all of our users but manually sorting out permissions for 200 folders would take an age; could someone please advise me if there is anyway to do this through VBScript?

I also have a small script which I run before the BGInfo script to make a BGInfo folder on the C: drive. I tried to include it at the beginning of the script above, but after it runs the first time, it brings back a "file exists" error and does not continue.

This is the script:


      

Is there a bit of if/else script that would check t see if the folder was there so it doesn't bring up the error - I'd like it as silent as possible.

Any help would be great!!

 
 
Post #: 1
 
 RE: Folder Permissions and Folder Creation - 7/9/2008 12:28:14 AM   
  ebgreen


Posts: 5041
Score: 31
Joined: 7/12/2005
Status: offline
So for the permissions, look at using xcacls.exe. For the If-Then logic look at the .FolderExists method of the FileSystemObject.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to zagadka)
 
 
Post #: 2
 
 RE: Folder Permissions and Folder Creation - 7/9/2008 2:51:57 AM   
  yehudah

 

Posts: 4
Score: 0
Joined: 7/9/2008
Status: offline
sorry for asking why not to run bginfo directly from the netlogon insted of copy it  ?

< Message edited by yehudah -- 7/9/2008 3:26:04 AM >


_____________________________

http://vbsondemand.blogspot.com/

(in reply to ebgreen)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Folder Permissions and Folder Creation Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts