vbScript provides the FileSystemObject object to create, delete and perform other manipulations on text files and the TextStream object to <u>sequentially</u> read, write and append text strings in text file. Unfortunately there is no built-in random access support for text file contents.
I believe these are the steps you need to perform to achieve deleting a random line from a text file:
1. Open the file for READ.
2. Use the ReadAll method to read the entire file in as a single string.
3. Split the single string into lines to create an array of strings.
4. Optionally, replace step 2 and 3 above with the ReadLine method to create your array of strings.
5. Close the file.
6. Open the file for WRITE.
7. Use the WriteLine method to write each of the lines from your array of strings, skipping the line you want to "delete".
8. Close the file.
This is of course ugly and cumbersome. Perhaps someone else can describe a better way using vbScript built-ins, or provide you with all/most of the above in a custom function.