would some assist me in creating a vbs script file to do the following
commands:

del /q "c:\Documents and Settings\%username%\cookies\*.*"

del /q "c:\Documents and Settings\%username%\Local Settings\Temp\*.*"

del /q "c:\Documents and Settings\%username%\Templates\*.*"
del /s /a:h /q "c:\Documents and Settings\%username%\*.tmp"

del /q "c:\Documents and Settings\%username%\Templates\*.*"

rmdir /s /q "c:\Documents and Settings\%username%\Local Settings
\Temporary Internet Files"
rmdir /s /q "c:\Documents and Settings\%username%\Local Settings\Temp"

i'm trying to use a .vbs file rather than a .bat file for this process
for my users to clear out data from the above locations.

thank you in advance,
don

Re: Script to remove and create directories by mr_unreliable

mr_unreliable
Sat Feb 24 10:42:44 CST 2007

hi dongle,

You have several options.

If you wish to go "pure" script, then read up on the
file system object (fso) which allows for deleting
files and directories (oops, folders).

If you only wish to use a script, but keep your bat
commands, then you could just include the commands
in your script as text strings, write them to some
temporary location (e.g., win/temp), and then use
shell.run to run the (dos) batch file.

Or, there is also the "hybrid" approach. Instead of
writing your bat commands to disk, you could run them
directly, one-by-one, using shell.run as follows:

Set oShell = CreateObject("WScript.Shell")

With oShell
.Run "%comspec% /c " & "your 1st bat cmd", 0, true
.Run "%comspec% /c " & "your 2nd bat cmd", 0, true
.Run "%comspec% /c " & "your 3rd bat cmd", 0, true
etc, etc...
End With

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)



donglelock wrote:
> would some assist me in creating a vbs script file to do the following
> commands:
>
> del /q "c:\Documents and Settings\%username%\cookies\*.*"
>
> del /q "c:\Documents and Settings\%username%\Local Settings\Temp\*.*"
>
> del /q "c:\Documents and Settings\%username%\Templates\*.*"
> del /s /a:h /q "c:\Documents and Settings\%username%\*.tmp"
>
> del /q "c:\Documents and Settings\%username%\Templates\*.*"
>
> rmdir /s /q "c:\Documents and Settings\%username%\Local Settings
> \Temporary Internet Files"
> rmdir /s /q "c:\Documents and Settings\%username%\Local Settings\Temp"
>
> i'm trying to use a .vbs file rather than a .bat file for this process
> for my users to clear out data from the above locations.
>
> thank you in advance,
> don
>