This is part of a set of scripts that I was writing to setup WordPress the way I want.
This one deleted the Hello Dolly plugin, the script has to go in the root where wordpress was installed (in beside the config, htaccess files). This was tested on XAMPP on a Windows machine.
if (file_exists(WP_PLUGIN_DIR . ‘/hello.php’))
echo “Hello Dolly deleted”;