Wikipedia:Cmd.exe deletion script
Appearance
Script for quick deletion. Admin-use only. It was created by User:CO, modified by User:ReedyBoy, and first tested by User:Anonymous Dissident. What it does This is a speedy-deletion script. It fetches pages from categories, shows the text, and, with a simple command, the page can be deleted or not deleted. After the choice is made, the next page in a category is fetched, and so on. Before use, please remember to modify the script as needed; bold pieces of the script comprise the text that needs to be modified. Don't worry; a zero-knowledge of programming is required. Pre-requisite downloads and necessaries: * Dotnetwikibot framework. * A text editor application, such as Notepad. * cmd.exe * You must be a Wikipedia administrator to use the script.</nowiki> Installation and configuring: 1. Download dotnetwikibot framework, and save in a folder, entitled C:\CBot2. Open up a text editor, such as notepad 3. Insert the script, making necessary modifications in the right places. 4. Save file as
C:\CBotdelete.cs
, in the same folder that dotnetwikibot framework () 5. Open
cmd.exe
6. Type incd:\CBot
and hit enter 7. Paste the following into thecmd.exe
:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc delete.cs /debug:full /o- /reference:DotNetWikiBot.dll
8. Hit the enter key. The .cs file should now compile into a.exe
inC:\CBot
. 9. Now simply type "delete.exe" and hit enter into thecmd.exe
, and the file should execute. How to use: * After you do all of the above, the cmd.exe should display several messages. Among others: * The page at en.wiki should be grabbed * You should log in * The script will search the relevant cat, grab pages. * Display the text of the pages in the category, one at a time * At this point, the script will ask you whether you want to delete or not delete the page in question. * Typing in "N" and hitting enter at this time will not delete the page * Typing in "Y" and hitting enter at this time will delete the page. Things to change Before you use the script, you will need to make some slight modifications. * "YOURUSERNAMEGOESHERE" - change this part of the script to whatever your username is: ie. "Anonymous Dissident". Forget theUser:
prefix. * "YOURPASSWORDGOESHERE" - your password. Don't fear for password security - remember, the modified version of the script specific to you will only be readily available on your own home PC. * "CATEGORYNAME(DO NOT INCLUDE THE CATEGORY: PREFIX" - the category from which the pages are to be fetched from: ie. "Attack pages for speedy deletion" In case you didn't figure, theCategory:
prefix isn't needed. * "REASON FOR DELETION" - modify to a generic, simple reason for deletion that will be repeatedly used as a deletion summary while you make use of the script.</nowiki> I hope this script proves useful.
/**
* The script. Copy as needed.
*/
using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Xml;
using System.Diagnostics;
using System.Threading;
using DotNetWikiBot;
class MyBot : Bot
{
public static void Main()
{
Site enWP = new Site("http://en.wikipedia.org", "YOURUSERNAMEGOESHERE", "YOURPASSWORDGOESHERE");
PageList pl = new PageList(enWP);
PageList plSave = new PageList(enWP);
// Pages to delete
pl.FillFromCategory("CATEGORYNAME(DO NOT INCLUDE THE CATEGORY: PREFIX)");
pl.LoadEx();
foreach (Page i in pl)
if (i.text.Contains(""))
{
Console.Write("Would you like to delete " + i.title + " (Y/N)? ");
if (Console.ReadLine().ToUpper() == "Y")
{
i.Delete("REASON FOR DELETION");
}
}
}