Re: Help Me Fix Script
- From: "Roland Hall" <nobody@nowhere>
- Date: Mon, 7 Nov 2005 11:54:15 -0600
"Dennis Marks" <denmarks@xxxxxxxxx> wrote in message
news:1131328491_6557@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
: Months ago I used the following vbs script to extract all the ID3 tags
from
: a directory and put them in a tab delimited file. The file could then be
: opened in a spreadsheet. I lost the script but was able to locate a
version
: on the internet that may not be complete. I don't even remember how to use
: it. Can someone look at the script, tell me if it is complete and how do I
: use it? I find reference to the output file but I'm not sure how to
: associate it with the directory. BTW: as you can see I am not a VBS
: programmer.
:
: Set objShell = CreateObject("Shell.Application")
: Set Ag=Wscript.Arguments
: Set Fldr=objShell.NameSpace(Ag(0))
: Set FldrItems=Fldr.Items
: Set fso = CreateObject("Scripting.FileSystemObject")
: FName="c:\documents and settings\Dennis Marks\my documents\Directory
: List.txt"
: Set ts = fso.OpenTextFile(FName, 2, vbtrue)
: For x = 0 to 50
: t1 = t1 & Fldr.GetDetailsOf(vbnull, x) & vbtab
: Next
: ts.write FLDR.self.path & vbcrlf
: ts.Write T1 & vbcrlf
: T1=""
: For Each FldrItem in FldrItems
: For x = 0 to 50
: t1 = t1 & Fldr.GetDetailsOf(FldrItem, x) & vbtab
: Next
: t1=t1 & vbcrlf
: ts.Write T1
: T1=""
: Next
: msgbox FName & " has a tab delimited list of all properties"
A slightly modified version:
Option Explicit
dim oShell, oArgs, oFolder, fso, filename, f, i, arr, pathto, files, file
pathto = "c:\"
set oShell = CreateObject("Shell.Application")
set oArgs = Wscript.Arguments
if oArgs.count = 0 then
msgbox "Error: Argument not included"
wscript.echo "You must include the full path to a folder as an argument"
wscript.quit
end if
set oFolder = oShell.NameSpace(oArgs(0))
set fso = CreateObject("Scripting.FileSystemObject")
arr = split(oFolder,"\")
filename = pathto & arr(ubound(arr)) & ".txt"
set f = fso.OpenTextFile(filename, 2, true)
for i = 0 to 50
files = files & oFolder.GetDetailsOf(vbNull, i) & vbTab
Next
f.write oFolder.self.path & vbCrLf
f.Write files & vbcrlf
files = ""
for each file in oFolder.items
for i = 0 to 50
files = files & oFolder.GetDetailsOf(file, i) & vbTab
Next
files = files & vbcrlf
f.Write files
files = ""
Next
f.close
msgbox "A list of files in " & oArgs(0) & " have been written to " &
filename
set f = nothing
set fso = nothing
set oFolder = nothing
set oArgs = nothing
set oShell = nothing
I called it props.vbs. Call it with: cscript props.vbs [full path to
folder]
Ex. cscript props.vbs c:\myfiles
If the path to the folder has a space, you must include it in double-quotes.
Ex. cscript props.vbs "c:\my files"
You can change the pathto variable to the folder you want to write the
output file to. The output file will have the folder name that was
processed.
HTH...
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
.
- References:
- Help Me Fix Script
- From: Dennis Marks
- Help Me Fix Script
- Prev by Date: RE: New to scripting - Help creat a scrip to move files based on date?
- Next by Date: Writing vbscript to Install Apps with Elevated Rights and Groups
- Previous by thread: Re: Help Me Fix Script
- Next by thread: Help with remote script
- Index(es):
Relevant Pages
|