Showing results for files - Scripting Blog [archived]

Mar 7, 2005
Post comments count0
Post likes count0

How Can I Tell If a File Exists on a CD or DVD Drive?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! How can I tell whether a file exists on any CD or DVD drive connected to a computer?-- GH Hey, GH. Well, one way to do this would be to search the entire file system - including any mapped network drives - and check to see if a file (let’s call it Budget.xls) can be found anywhere. Assuming you find such a file, you can then ...

Scripting Guy!VBScriptstorage
Feb 18, 2005
Post comments count0
Post likes count0

How Can I List the Files in a Folder and All Its Subfolders?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! How can I list all of the files in a folder, as well as all the files in any subfolders of that folder?-- MA Hey, MA. This is a question we get asked quite a bit, and one which have avoided answering up till now. That’s because there is no nice, simple answer to this one: a script that can carry out this task is bound to be a...

Scripting Guy!VBScriptstorage
Jan 14, 2005
Post comments count0
Post likes count0

How Can I Tell if a Folder Has Any Files with a Specific File Extension?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! How can I verify whether or not any files with a specific file extension exist in a folder?-- GM Hey, GM. This is actually a pretty easy thing to do. All we have to do is write a WMI query that includes the path of the folder we want to check as well as the file extension we’re checking for. For example, this script retrieves...

Scripting Guy!scripting techniquesVBScript
Dec 9, 2004
Post comments count0
Post likes count0

How Can I Rename Files Based on the File’s Creation Date?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I have a folder that contains a bunch of log files. I would like to rename each file based on the date the file was created; for example, if a file was created on December 1, 2004, I’d like to rename it 20041201.log. Is that possible?-- CK Hey, CK. Listen, when it comes to scripting, anything is possible. (Well, except for th...

Scripting Guy!VBScriptstorage
Nov 9, 2004
Post comments count0
Post likes count0

Can I Use a Script to Rename All the Files in a Folder?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! Can I use a script to rename all the files in a directory and include a "pl-" prefix plus the original file name?-- JP Hey, JP. It’s interesting how many people need to do something similar: they need to rename all the files in a given folder, either by appending the date, changing the file extension, or - in this case - tack...

Scripting Guy!VBScriptstorage