script to delete user folder/files...
Results 1 to 2 of 2

Thread: script to delete user folder/files...

  1. #1
    Registered User techie211's Avatar
    Join Date
    Aug 2001
    Posts
    49

    Question script to delete user folder/files...

    we are cleaning out our systems for the summer and have laptop carts with about 24 laptops in each cart. I would like to delete their folder/sub-folders & files within "C:\Documents and Settings". Is there a way to have the script prompt the user for a folder name so they can use it on multiple carts? I wrote a small batch file but the 'folder' name would have to be changed everytime for the different carts any help is appreciated

    -j

  2. #2
    Tech-To-Tech Mod kato2274's Avatar
    Join Date
    Sep 2001
    Location
    Bentleyville, Pa
    Posts
    2,317
    Quote Originally Posted by techie211
    we are cleaning out our systems for the summer and have laptop carts with about 24 laptops in each cart. I would like to delete their folder/sub-folders & files within "C:\Documents and Settings". Is there a way to have the script prompt the user for a folder name so they can use it on multiple carts? I wrote a small batch file but the 'folder' name would have to be changed everytime for the different carts any help is appreciated

    -j
    this is very basic. . . . as I am not much of a programmer. . . . but here is vbscript to do it. . . . and it seems to work on my machine.

    an input box will appear and ask for a username. then the computer will delete the c:\documents and settings\username folder. the box will reappear for another input and continue to do so until the username is "exit" (don't type the quotations)

    here is the script. past it into notepad and give the file a .vbs extension
    Dim WSHShell
    Dim Message
    Dim Title
    Dim username
    language= 0
    username =""
    do
    Message = "Enter the username you wish to delete"
    Title = "delete user folders"
    Set WSHShell = WScript.CreateObject("WScript.Shell")
    result = InputBox(Message,Title, "", 100, 100)
    username = result
    if username ="exit" then wscript.quit
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    fso.DeleteFolder "C:\documents and settings\" & username, True
    loop

Similar Threads

  1. [RESOLVED] 70-240: LETS DO THIS!!
    By 70-240 in forum Certification
    Replies: 14
    Last Post: February 20th, 2012, 03:35 AM
  2. using a VB script to change user settings
    By techie211 in forum Programming And Web Design
    Replies: 2
    Last Post: April 23rd, 2004, 10:11 PM
  3. group policy?---advanced
    By qwicker in forum Windows XP
    Replies: 2
    Last Post: October 15th, 2003, 06:12 AM
  4. unauthorized access?
    By Poseidon in forum Spyware & Antivirus - Security
    Replies: 10
    Last Post: June 11th, 2002, 03:58 AM

Bookmarks

Posting Permissions

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