deleting folder with VBS\batch file

Networking/Security Forums -> Programming and More

Author: BattousaiLocation: Doncaster, UK PostPosted: 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 PostPosted: 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 /?



Networking/Security Forums -> Programming and More


output generated using printer-friendly topic mod, All times are GMT + 2 Hours

Page 1 of 1

Powered by phpBB 2.0.x © 2001 phpBB Group