Author: Battousai, Location: Doncaster, UKPosted: Thu Nov 18, 2010 1:33 pm Post subject: deleting folder with VBS\batch file ---- i need a script to delete a folder from the local drive when a user logs onto the domain (windows 7 client).
the two ways i've been looking at are:-
Batch:-
@echo off
rmdir /s /q "C:\Users\%username%\Documents"
but as far as i can tell rmdir will not delete a folder if it has anything in the folder
VBS:-
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFolder("c:\users\teststudent\documents\")
but the problem with the VBS script is i would need every username in the domain to be listed as %username% doesn't work (as far as i know) in VB...
can anyone help me out?
Author: krugger, Posted: Fri Nov 19, 2010 5:39 pm Post subject: ---- rmdir /s /q DIR
Should delete the directory and all files in it without prompting.
At least that is what the help says:
rmdir /?