Hi
I'm searching for a vbscript which would help me in displaying the folder
details. eg. i want the folder view to be "Details" & with more columns like
"Title, Artist, Album title" etc.
can someone help.. thanks..

regards
Raghu

Re: Display various columns in "Details Folder" settings by Luuk

Luuk
Sat Mar 08 13:41:19 CST 2008

Raghu schreef:
> Hi
> I'm searching for a vbscript which would help me in displaying the folder
> details. eg. i want the folder view to be "Details" & with more columns like
> "Title, Artist, Album title" etc.
> can someone help.. thanks..
>
> regards
> Raghu
>
>

http://tinyurl.com/26ugo9

or do you mean something else?

--
Luuk

Re: Display various columns in "Details Folder" settings by noone

noone
Wed Mar 12 11:50:01 CDT 2008

Il giorno Sun, 9 Mar 2008 00:44:14 +0530, "Raghu" <te.raghu@gmail.com> ha scritto:
>I'm searching for a vbscript which would help me in displaying the folder
>details. eg. i want the folder view to be "Details" & with more columns like
>"Title, Artist, Album title" etc.
>can someone help.. thanks..

The first displays some info taken from the shell, the second uses mediaplayer to retrieve
title, artist, album title, bitrate, duration, ecc.

'<%
'************************************************
' File: Directory in XL.vbs (VBScript)
' Author: Giovanni Cenati
'
' Mostra in un foglio di excel l'elenco dei
' files della directory trascinata sopra l'icona
' dello script.
' Shows the directory list in an excel sheet.
' http://digilander.libero.it/Cenati Codice vbscript
' liberamente utilizzabile citando il sito.
'************************************************
Dim oXL, oFile, objArgs,path,objShell,objShellFolder,i
dim Riga ' as the excel row where to show data
Title = "Directory in Excel - Cenati Giovanni"

Set objArgs = WScript.Arguments 'Vedo se ci sono degli argomenti passati allo script
if objargs.count=0 then 'altrimenti mostro come si usa il programma
msgbox "Trascinare una directory sul programma per averne l'elenco dei
files",vbinformation+vbokonly, Title
'msgbox "Drag a folder on the script icon to have the directory list in an excel
sheet.",vbinformation+vbokonly, Title
wscript.quit
end if
path = objArgs(0) 'questa variabile contiene il nome della directory da leggere

'Prepara l'accesso ai dati forniti dalla shell. Non funziona in Win NT4 sp6
'Creates needed objects - In WinNT Shell.app can't be instanced.
Set objShell=WScript.CreateObject("Shell.application")
Set objShellFolder=objshell.namespace(path)

'EXCEL: crea oggetto, lo rende visibile, aggiunge un foglio di lavoro.
'Creates excel sheet, make it visible, adds a workbook.
Set oXL = WScript.CreateObject("Excel.Application")
oXL.Visible = TRUE
oXL.WorkBooks.Add

'Intestazione delle colonne - Column headers
oXL.cells(1,1)= "Directory: "
oXL.cells(1,2)= path
for i=0 to 50 'Intestazioni delle colonne - Columns headers
oXL.cells(2, 1+i) = objShellFolder.getdetailsof(objShellFolder.items,i)
next

Riga=3
For Each oFile In objShellFolder.items 'recupero le informazioni sui files
'Chiede a Windows alcune altre informazioni sul file.
'Attenzione: a seconda delle versioni di windows, le colonne
'riportano dati diversi. Con winME ho il nome + 16 attributi.
'Warning: different OS report different data in different columns.
'this retrieves 50 infos + the filename (in Win ME).
for i=0 to 50
oXL.cells(Riga, 1+i) = objShellFolder.getdetailsof(oFile,i)
next
Riga=riga+1
Next

wscript.quit
'*** End ***


--------------------------------------------------------------------------------------------------------------------------------




'************************************************
' File: Lista file Mp3.vbs
' Autore: Giovanni Cenati Reventlov @ katamail . com
' Crea in excel una lista dei files Mp3 con alcuni dati aggiuntivi.
' Creates an excel file with a list of Mp3 files and some additional data.
' 2004/11/02
'************************************************
Set Player = createobject("wmplayer.ocx.7")
Set fso = CreateObject("Scripting.FileSystemObject")
set oXL = WScript.CreateObject("Excel.Application")
oXL.Visible = TRUE
oXL.WorkBooks.Add

'drive= inputbox ("Scan which drive?","List of Mp3 files - Cenati Giovanni","C:\")
drive= inputbox ("Nome del drive in cui cercare:","Lista files Mp3 - Cenati
Giovanni","C:\")
Mp3List= GetListOfMp3Files(drive)
songslist = Split(Mp3List, vbCrLf) 'Creates an array of the lines of the file
Mp3List=""

dim attr(10)
attr(1)= "Artist"
attr(2)= "Album"
attr(3)= "Author"
attr(4)= "Bitrate"
attr(5)= "CreationDate"
attr(6)= "Genre"

' Column Headers - Intestazioni delle colonne
oXL.cells(1,1)="File Name"
oXL.cells(1,2)="Name"
oXL.cells(1,3)="Durata(secondi)"
oXL.cells(1,4)="Durata(min,sec)"
for i= 1 to ubound(attr)
oXL.cells(1,4+i)=attr(i)
next
oXL.cells(1,11)="File size"
oXL.cells(1,12)="File date"

on error resume next 'for song names with accents àèìòù
for songnumber=0 to ubound(songslist)
row=songnumber+2
player.mediaCollection.add(songslist(songnumber))
player.url=songslist(songnumber)

oXL.cells(row,1)= songslist(songnumber)
oXL.cells(row,2)= player.currentmedia.name
oXL.cells(row,3)= player.currentmedia.duration
oXL.cells(row,4)= player.currentmedia.durationstring
for a=1 to 6
oXL.cells(row,4+a)=
player.currentMedia.getItemInfobyAtom(player.mediaCollection.getMediaAtom(attr(a)))
next
set f = fso.GetFile(songslist(songnumber))
oXL.cells(row,11)= f.size
oXL.cells(row,12)= f.DateCreated

wscript.sleep 60 'Altrimenti si blocca - Otherwise it hangs
next
oxl.cells(1,1).select
set oXl=nothing
msgbox "End of job - Cenati Giovanni" ,,"List of Mp3 Files"

function GetListOfMp3Files(drive)
dim fso, tmp, wshshell, ofile, path
cmd = "dir "& trim(drive) & "*.mp3 /s/b " ' Comando DOS
Const tmpFolder=2
Set fso = CreateObject("Scripting.FileSystemObject")
' Chiede al sistema un nome di file temporaneo.
' Asks Windows a unique temporary file name
tmp = fso.GetTempName
' Recupera il path del file temporaneo.
' Gets the complete path of the temp file
path = fso.GetSpecialFolder(tmpFolder)
tmp = path & "\" & tmp ' Questo è il pathname completo del file tmp.
' Crea un oggetto WshShell... Creates the needed wshell object
Set WshShell = CreateObject("WScript.Shell")
' Esegue il comando dos e redirige l'output sul file tmp
' Executes dos command and redirects the output on the tmp file
WSHShell.Run "%comspec% /c " & cmd & " >" & tmp, 0, True
' Legge il contenuto del file. Reads the content
Set oFile = fso.OpenTextFile(tmp)
GetListOfMp3Files = oFile.ReadAll
oFile.Close 'lo chiude - Closes the file
fso.DeleteFile tmp ' e lo cancella - and deletes it
end function
' *** End ***


--
Giovanni Cenati (Bergamo, Italy)
Write to user "Reventlov" and domain at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--

Re: Display various columns in "Details Folder" settings by Keith

Keith
Sun Mar 16 18:10:36 CDT 2008

If you want to select columns on the fly, I don't know how to do that -
don't think it can be done via script except with possibly SendKeys.

If you want to access a predefined layout and apply to other folders, you
can check out my script FolderViewMaster, it allows you to set all the view
details for a folder & all its subfolders. It is for XP only. It may be
just what you want, or you may find some useful code to study.

http://home.mchsi.com/~k.miller79/Scripts/

--
Good Luck,

Keith
Microsoft MVP [Windows Shell/User]



"Raghu" <te.raghu@gmail.com> wrote in message
news:uNJ$bCVgIHA.4880@TK2MSFTNGP03.phx.gbl...
> Hi
> I'm searching for a vbscript which would help me in displaying the folder
> details. eg. i want the folder view to be "Details" & with more columns
> like "Title, Artist, Album title" etc.
> can someone help.. thanks..
>
> regards
> Raghu
>


Re: Display various columns in "Details Folder" settings by mayayana

mayayana
Sun Mar 16 21:06:39 CDT 2008

Your link leads to an empty page that says,
"No content. This user hasn't moved in yet."

> If you want to select columns on the fly, I don't know how to do that -
> don't think it can be done via script except with possibly SendKeys.
>
> If you want to access a predefined layout and apply to other folders, you
> can check out my script FolderViewMaster, it allows you to set all the
view
> details for a folder & all its subfolders. It is for XP only. It may be
> just what you want, or you may find some useful code to study.
>
> http://home.mchsi.com/~k.miller79/Scripts/
>
> --
> Good Luck,
>
> Keith
> Microsoft MVP [Windows Shell/User]
>
>
>
> "Raghu" <te.raghu@gmail.com> wrote in message
> news:uNJ$bCVgIHA.4880@TK2MSFTNGP03.phx.gbl...
> > Hi
> > I'm searching for a vbscript which would help me in displaying the
folder
> > details. eg. i want the folder view to be "Details" & with more columns
> > like "Title, Artist, Album title" etc.
> > can someone help.. thanks..
> >
> > regards
> > Raghu
> >
>



Re: Display various columns in "Details Folder" settings by mayayana

mayayana
Sun Mar 16 23:28:05 CDT 2008

What you want to do is so involved that it
may not be worth the trouble, but here goes.....

Like most things that Microsoft designs, the Registry design for folder
settings is an unspeakable mess. Under normal circumstances XP saves
information about folder views for every folder opened. But it doesn't save
the info. properly and then doesn't pay attention to what was saved
unless forced to! However, there is a system to control folder views
for each folder, and you can force it to work.

The action is all happening here:

HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\Bags
HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\BagMRU

The BagMRU key contains a tree of subkeys that are an index of keys under
the Bags key. Both keys contain subkeys that represent folders. The
BagMRU key seems to mimic the Windows folder structure, while the
Bags subkeys are created - and numbered - based on when a folder was
opened. There's one key for each folder you have opened.

It appears that the first level of BagMRU subkeys represent drives, with
subkey structure reflecting folder structure. Each key has numbered values
representing subfolders and a value named "NodeSlot". The numbered values
have binary data that contains the name of a subfolder as well as some kind
of encoding.

Example:

HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\BagMRU\0
is likely to be C drive (though I'm not certain it has to be).
Say there are 2 folders on C drive, named "apple" and "orange".
The BagMRU\0 key will then contain 3 values something like this:

value: 0
data: binary data containing, among other things, the name "apple"

value: 1
data: binary data containing, among other things, the name "orange"

value: NodeSlot
data: 8 (dword)


That means that the "apple" folder is represented by a BagMRU\0\0\
key and the "orange" folder is represented by a BagMRU\0\1\ key.
Those keys, in turn, will hold numeric values for each subfolder in apple
and orange. The value 8 in NodeSlot means that the C drive folder
settings are represented under Bags\8. (The BagMRU keys are only
the index for the real settings keys.)

Imagine that the apple folder has four subfolders named Cortland, Empire,
Mac and Granny Smith. Then if you look under BagMRU\0\0\ (the apple subkey)
you'll see values named 0, 1, 2, 3 and corresponding subkeys named 0, 1, 2,
3.
So the first subfolder, named Cortland, has it's own key at BagMRU\0\0\0\
and the word "Cortland" will be part of the "0" value of the BagMRU\0\0\
key.

So here we have:
0\0\0\ = C:\apple\Cortland
0\0\1\ = C:\apple\Empire
0\0\2\ = C:\apple\Mac
0\1\ = C:\orange

Imagine BagMRU\0\0\ (the apple subkey) has a value "NodeSlot" with data
of 26. That means that the actual settings info. for the apple folder is in
the Bags\26\ key.

So the first problem here is that you need an enumeration routine
to find the actual BagMRU key that corresponds to the folder of
interest.

Assume you found that. Assume you want the apple folder and now you
know that it's represented in Bags\26\. So now you go there. There may
be almost no settings there. Or there may be a great number of settings
that are virtually undocumented. Again, the design is a mess, with
unnecessary
redundancy and a generous helping of gratuitous abstruseness.
To set Details view you need to add the following values:

Value: Mode
Data: 4 (dword)

Value: Vid
Data: {137E7700-3573-11CF-AE69-08002B2E1262} (string)

Value: WFlags
Data: 0 (dword)

Mode and Vid are redundant values that specify view mode.
WFlags is required in order to make Explorer pay attention to
these settings in the first place. For good measure, if these
settings don't do the trick, also add these:

FFlags 0
Status 0

There's also a value "Col" set to 0. I don't know if that one matters.
It doesn't seem to.

Now that you've specified Detail view and made Explorer pay attention,
the actual columns are in the binary value "ColInfo". I'm afraid that I
don't know the format for that. The number in the 23rd place seems to
specify number of columns. Following that is presumably specific column
type and column width data. You'd have to experiment to figure out how
to specify exactly what you want by writing to the Registry directly.
But if you do all that you should be able to set any given folder at will.
The only limitation I can think of is that the folder must have been
opened at some time in order to have a Registry key in this mess.
Setting the display values is fairly simple once you know them, but
finding the actual key under "Bags" for a specific folder will require
walking the BagMRU subkeys and figuring out a way to extract folder names.
If you look in one of the numeric binary values, like say the value "0"
under BagMRU\0\, you'll see that it holds both the DOS name and the
Windows name for the folder, but it also contains other data that is
probably not documented. There's gobbledygook, followed by the
folder's DOS name in ASCI format, followed by Chr(0), followed by
more gobbledygook, then a unicode string that goes like this:
chr(0) foldername chr(0).

I'm guessing that the BagMRU key represents the actual filesystem in
order,
though I'm not certain. But assuming it does, you should be able to
walk BagMRU\0\ numeric values and parse the binary data to get the
direct C:\ subfolders. Then step down through until you get the folder
you want. In other words, in BagMRU\0\, enumerate the values and
read each that has a numeric name (0, 1, 2, etc.) until you find the
name of the first folder under C:\ in your path. Then go to that subkey:
If you found your folder in BagMRU\0\ value "4" then go to BagMRU\0\4\
and repeat the enumeration of numeric values to get your next folder
down. Etc.




> I'm searching for a vbscript which would help me in displaying the folder
> details. eg. i want the folder view to be "Details" & with more columns
like
> "Title, Artist, Album title" etc.
> can someone help.. thanks..
>
> regards
> Raghu
>
>



Re: Display various columns in "Details Folder" settings by Paul

Paul
Tue Mar 18 19:43:21 CDT 2008

I guess he hasn't completely moved in. You can access the file here:
http://home.mchsi.com/~k.miller79/

-Paul Randall

"mayayana" <mayaXXyana1a@mindXXspring.com> wrote in message
news:%23PpLRO9hIHA.4344@TK2MSFTNGP03.phx.gbl...
> Your link leads to an empty page that says,
> "No content. This user hasn't moved in yet."
>
>> If you want to select columns on the fly, I don't know how to do
>> that -
>> don't think it can be done via script except with possibly
>> SendKeys.
>>
>> If you want to access a predefined layout and apply to other
>> folders, you
>> can check out my script FolderViewMaster, it allows you to set all
>> the
> view
>> details for a folder & all its subfolders. It is for XP only. It
>> may be
>> just what you want, or you may find some useful code to study.
>>
>> http://home.mchsi.com/~k.miller79/Scripts/
>>
>> --
>> Good Luck,
>>
>> Keith
>> Microsoft MVP [Windows Shell/User]
>>
>>
>>
>> "Raghu" <te.raghu@gmail.com> wrote in message
>> news:uNJ$bCVgIHA.4880@TK2MSFTNGP03.phx.gbl...
>> > Hi
>> > I'm searching for a vbscript which would help me in displaying
>> > the
> folder
>> > details. eg. i want the folder view to be "Details" & with more
>> > columns
>> > like "Title, Artist, Album title" etc.
>> > can someone help.. thanks..
>> >
>> > regards
>> > Raghu
>> >
>>
>
>



Re: Display various columns in "Details Folder" settings by Keith

Keith
Wed Mar 19 17:49:48 CDT 2008

Whoops! The script link is:

http://home.mchsi.com/~k.miller79/Scripts/FVM3.zip


--
Good Luck,

Keith
Microsoft MVP [Windows Shell/User]



"mayayana" <mayaXXyana1a@mindXXspring.com> wrote in message
news:%23PpLRO9hIHA.4344@TK2MSFTNGP03.phx.gbl...
> Your link leads to an empty page that says,
> "No content. This user hasn't moved in yet."
>
>> If you want to select columns on the fly, I don't know how to do that -
>> don't think it can be done via script except with possibly SendKeys.
>>
>> If you want to access a predefined layout and apply to other folders, you
>> can check out my script FolderViewMaster, it allows you to set all the
> view
>> details for a folder & all its subfolders. It is for XP only. It may be
>> just what you want, or you may find some useful code to study.
>>
>> http://home.mchsi.com/~k.miller79/Scripts/
>>
>> --
>> Good Luck,
>>
>> Keith
>> Microsoft MVP [Windows Shell/User]
>>
>>
>>
>> "Raghu" <te.raghu@gmail.com> wrote in message
>> news:uNJ$bCVgIHA.4880@TK2MSFTNGP03.phx.gbl...
>> > Hi
>> > I'm searching for a vbscript which would help me in displaying the
> folder
>> > details. eg. i want the folder view to be "Details" & with more columns
>> > like "Title, Artist, Album title" etc.
>> > can someone help.. thanks..
>> >
>> > regards
>> > Raghu
>> >
>>
>
>


Re: Display various columns in "Details Folder" settings by Keith

Keith
Wed Mar 19 18:31:58 CDT 2008

"mayayana" <mayaXXyana1a@mindXXspring.com> wrote in message
news:%23H11Sd%23hIHA.6084@TK2MSFTNGP06.phx.gbl...
>
> It appears that the first level of BagMRU subkeys represent drives, with
> subkey structure reflecting folder structure.

Close, the structure of BagMRU mirrors the namespace. The BagMRU key is the
Desktop. First level subkeys will be Desktop namespace items (Computer,
Network, Control Panel, Search, etc) and any folders on the Desktop. Drives
are second level below Computer. Basically, the path in BagMRU reflects the
folders location in the Folder pane in Explorer.


> I'm guessing that the BagMRU key represents the actual filesystem in
> order,
> though I'm not certain. But assuming it does, you should be able to
> walk BagMRU\0\ numeric values and parse the binary data to get the
> direct C:\ subfolders. Then step down through until you get the folder
> you want. In other words, in BagMRU\0\, enumerate the values and
> read each that has a numeric name (0, 1, 2, etc.) until you find the
> name of the first folder under C:\ in your path. Then go to that subkey:
> If you found your folder in BagMRU\0\ value "4" then go to BagMRU\0\4\
> and repeat the enumeration of numeric values to get your next folder
> down. Etc.
>

I opted for a brute-force approach to determining the Bag # associated with
a folder :)

Export the Bags key, delete it, open & close the folder in question and then
look to see which Bag # was recreated. Then restore the exported key.



--
Good Luck,

Keith
Microsoft MVP [Windows Shell/User]




Re: Display various columns in "Details Folder" settings by mayayana

mayayana
Wed Mar 19 22:33:30 CDT 2008

>
> I opted for a brute-force approach to determining the Bag # associated
with
> a folder :)
>
> Export the Bags key, delete it, open & close the folder in question and
then
> look to see which Bag # was recreated. Then restore the exported key.
>

Interesting. I got your script. It looks like it will
fill in what's missing in my knowledge of these settings.
Thanks.



Re: Display various columns in "Details Folder" settings by Keith

Keith
Wed Mar 19 23:42:22 CDT 2008

You're welcome.

--
Good Luck,

Keith
Microsoft MVP [Windows Shell/User]



"mayayana" <mayaXXyana1a@mindXXspring.com> wrote in message
news:uXWXxsjiIHA.1944@TK2MSFTNGP02.phx.gbl...
> >
>> I opted for a brute-force approach to determining the Bag # associated
> with
>> a folder :)
>>
>> Export the Bags key, delete it, open & close the folder in question and
> then
>> look to see which Bag # was recreated. Then restore the exported key.
>>
>
> Interesting. I got your script. It looks like it will
> fill in what's missing in my knowledge of these settings.
> Thanks.
>
>