|
-
July 19th, 2004, 09:21 AM
#1
Registered User
-
July 19th, 2004, 10:56 AM
#2
Tech-To-Tech Mod
 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
-
By 70-240 in forum Certification
Replies: 14
Last Post: February 20th, 2012, 03:35 AM
-
By techie211 in forum Programming And Web Design
Replies: 2
Last Post: April 23rd, 2004, 10:11 PM
-
By qwicker in forum Windows XP
Replies: 2
Last Post: October 15th, 2003, 06:12 AM
-
By Poseidon in forum Spyware & Antivirus - Security
Replies: 10
Last Post: June 11th, 2002, 03:58 AM
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
|
|
Bookmarks