+ Post New Thread
Results 1 to 8 of 8
Scripts Thread, Wanted: VBScript to delete folders from C: in Coding and Web Development; Im in need of a script that will delete folders from C: Now i can do it if the user ...
  1. #1
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,031
    Thank Post
    305
    Thanked 292 Times in 202 Posts
    Rep Power
    120

    Wanted: VBScript to delete folders from C:

    Im in need of a script that will delete folders from C:
    Now i can do it if the user has got permissions to access the C: but i need a way to run the script as an administrator so the folder will be deleted as users here cannot alter C:
    It is to delete local profiles of users when they log off. So i know that somewhere in the script needs to be c:\documents and settings\%username%

    Can someone help?

    Tim
    Last edited by timbo343; 6th February 2008 at 12:11 PM.

  2. #2
    GlennT's Avatar
    Join Date
    Sep 2006
    Location
    Zummmerzet!
    Posts
    249
    Thank Post
    19
    Thanked 17 Times in 16 Posts
    Rep Power
    20
    Can you not run it as a startup script?
    That would be the easiest way I think.

  3. #3
    kerrymoralee9280
    Guest
    Can this not be done with Active Directory? Failing that, a startup/shutdown script sounds like it will do the biz.

  4. #4
    GlennT's Avatar
    Join Date
    Sep 2006
    Location
    Zummmerzet!
    Posts
    249
    Thank Post
    19
    Thanked 17 Times in 16 Posts
    Rep Power
    20
    Quote Originally Posted by jinnantonnix View Post
    Edit: Damn your hide GlennT - one minute too late...
    Whoops! Sorry!

  5. #5

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,785
    Thank Post
    3,282
    Thanked 1,053 Times in 974 Posts
    Rep Power
    365

    local profiles


  6. #6
    timbo343's Avatar
    Join Date
    Dec 2005
    Location
    Leeds/York area, North Yorkshire
    Posts
    3,031
    Thank Post
    305
    Thanked 292 Times in 202 Posts
    Rep Power
    120
    With a startup/shutdown script, dont all the computers have to be in that particular group?

  7. #7
    GlennT's Avatar
    Join Date
    Sep 2006
    Location
    Zummmerzet!
    Posts
    249
    Thank Post
    19
    Thanked 17 Times in 16 Posts
    Rep Power
    20
    Quote Originally Posted by timbo343 View Post
    With a startup/shutdown script, dont all the computers have to be in that particular group?
    Are they not in the same OU?
    You could create a Policy linked to that OU and bob's your uncle!

  8. #8

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,156
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    Quote Originally Posted by GlennT View Post
    Are they not in the same OU?
    You could create a Policy linked to that OU and bob's your uncle!
    I'd certainly make sure that all "standard" workstations are under a top level OU - eg we have one called "allPCs"; that has sub-ous for each site then further OUs for each room.

    It means a policy can be attached to allpcs which applies to ... All PCs :-)

    Alternatively, link it at the domain level and make it check for servers (say) and exclude them (easy if your servers have a standard naming convention otherwise you can use WMI to find the software type and use that to exclude servers)

SHARE:
+ Post New Thread

Similar Threads

  1. VBScript / SQL Server
    By Gatt in forum Scripts
    Replies: 7
    Last Post: 23rd September 2011, 03:21 PM
  2. Replies: 5
    Last Post: 13th January 2008, 11:39 PM
  3. Replies: 15
    Last Post: 19th September 2007, 10:46 PM
  4. VBScript
    By StewartKnight in forum Coding
    Replies: 5
    Last Post: 1st May 2007, 11:04 AM
  5. Printer vbscript ?
    By mac_shinobi in forum Scripts
    Replies: 1
    Last Post: 14th September 2005, 08:21 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •