techie211
July 19th, 2004, 09:21 AM
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:mad: any help is appreciated;)
-j
kato2274
July 19th, 2004, 10:56 AM
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:mad: 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