Name: NotForProfit Date: April 27, 2005 at 15:37:39 Pacific Subject: Deleting files using VBscript OS: Windows 2000 CPU/Ram: unknown
Comment:
I am writing a script to backup files to a USB drive. I would like to delete the old backup folder and all its files then rebuild and populate the folder. Everything works except the delete part. I have tried to use the following code:
Set oShell = CreateObject("WScript.Shell")
oShell.Run "command.com /C rd /s/q e:\backup"
oShell.Run "command.com /C mkdir e:\backup"
the mkdir command works fine but the rd command does not work. Did they disable the abliity to delete files and directories in this way to make VBscript more secure. If so how could I make it work?
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE