Showing results for files - Scripting Blog [archived]

Oct 25, 2005
Post comments count0
Post likes count0

How Can I Delete a Backup File Created on the Previous Day?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! Each day we have a program that creates a file with a name similar to this: backup_20050607.bak. How can I delete the previous day’s file?-- JC Hey, JC. Hmmm, a script that goes out and automatically deletes whatever happened the day before. Boy, could we have used a script like that a few weeks ago! Yes, we know. But that’s ...

Scripting Guy!VBScriptstorage
Oct 20, 2005
Post comments count0
Post likes count0

How Can I Verify That a Folder Has Files in It and, If So, Delete Those Files?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! How can I verify that a certain folder (C:\TestLog) has files in it and, if so, delete all those files?-- DC Hey, DC. Before we begin we should point out that - when using WMI - it doesn’t matter whether or not a folder has any files in it: you can still tell WMI to delete all the files in that folder. If no such files exist ...

Scripting Guy!VBScriptstorage
Oct 3, 2005
Post comments count0
Post likes count0

How Can I List All the Files in a Folder, Ordered By Creation Date?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! How can I list all the files in a folder, ordered by creation date?-- CL Hey, CL. You know, if we were ambitious and hard-working, we’d sit down and write you a script that uses WMI to return all the files in a folder. That script would grab information about all those files and store that data in a disconnected recordset. We...

Scripting Guy!VBScriptstorage
Sep 26, 2005
Post comments count0
Post likes count0

How Can I Delete Specific Files in a Specific Folder?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! How can I access the files in the folder T:\Act and delete any files that have the string “current” somewhere in the file name?-- SC Hey, SC. We have to admit, the notion of deleting anything current has a certain appeal, doesn’t it? Well, not for the Scripting Guys, of course; after all, our lives are so perfect there isn’t ...

Scripting Guy!VBScriptstorage
Aug 26, 2005
Post comments count0
Post likes count0

How Can I Determine the 20 Largest Files on a Computer?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! How can I determine the 20 largest files on a computer?-- PW Hey, PW. Having recently returned from a vacation in Europe, the Scripting Guy who writes this column now understands that there are different ways to do things. Some of these would be difficult to adjust to on a regular basis: for example, ordering a soft drink in ...

Scripting Guy!VBScriptstorage