Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - w= cInt(left(info,inStr(info,"x") -1))

Reply
 
Old 02-21-2009   #1 (permalink)
Benny Pedersen


 
 

w= cInt(left(info,inStr(info,"x") -1))


We have a problem here

http://www.elementsvillage.com/forum...445#post442445

My System SpecsSystem Spec
Old 02-22-2009   #2 (permalink)
Todd Vargo


 
 

Re: w= cInt(left(info,inStr(info,"x") -1))

"Benny Pedersen" <b.pedersen@xxxxxx> wrote in message
news:4d59e483-24f0-43c2-84c7-6dec7adb9655@xxxxxx
Quote:
Benny, the information on this page...

http://msdn.microsoft.com/en-us/libr...70(VS.85).aspx

indicates that valid values for iColumn of getDetailsOf method are -1
through 4.
The value of 26 seems to be out of range.

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)


My System SpecsSystem Spec
Old 02-22-2009   #3 (permalink)
Paul Randall


 
 

Re: w= cInt(left(info,inStr(info,"x") -1))


"Todd Vargo" <tlvargo@xxxxxx> wrote in message
news:OpatJKQlJHA.3868@xxxxxx
Quote:

> "Benny Pedersen" <b.pedersen@xxxxxx> wrote in message
> news:4d59e483-24f0-43c2-84c7-6dec7adb9655@xxxxxx
Quote:

>>
>> We have a problem here
>>
>> http://www.elementsvillage.com/forum...445#post442445
>
> Benny, the information on this page...
>
> http://msdn.microsoft.com/en-us/libr...70(VS.85).aspx
>
> indicates that valid values for iColumn of getDetailsOf method are -1
> through 4.
> The value of 26 seems to be out of range.
Hi, Todd
Things only seem to be something based on what we believe to be the truth.
I think the page you reference is out of date or incomplete or just plain
wrong.

I have attached and listed below a VBScript that explores the Windows OS's
namespaces and the columns that can be displayed when a namespace is opened
as folder on the screen. It pops up two message boxes, and writes a file.
The first message box is a list of all the namespaces and their
corresponding namespace number. The second message box shows that many
namespaces share the same set of columns that windows explorer can display
for those namespaces, and groups those namespaces. The file created by the
script, SpecialFoldersInfo.txt, list those groups and the column headings
for each group. I see column numbers in the 50's.

-Paul Randall

'Go through all the special folders and list all the details
' that can be displayed for the items they may contain.

Option Explicit
Dim i, oShell, oShFolder, sMsg, sNameSpace, iCount
Dim iTemp, sItem, Temp
Dim odSpecFldrs
Set odSpecFldrs = CreateObject("scripting.dictionary")
odSpecFldrs.comparemode = vbTextCompare
Dim odSpecFldrDesc
Set odSpecFldrDesc = CreateObject("scripting.dictionary")
odSpecFldrDesc.comparemode = vbTextCompare

Set oShell = CreateObject("Shell.Application")

'Assuming shell namespaces are numbered from 0 to 255,
' create a dictionary containing keys consisting of an
' alphabetic list of namespace titles followed by a comma
' and the namespace number. For example, there may be
' keys like: Desktop,0 and Desktop,16 and Desktop,25.
For i = 0 To 255
Set oShFolder = oShell.NameSpace(i)
If TypeName(oShFolder) <> "Nothing" Then
odSpecFldrs(i) = oShFolder.Title & "," & i
End If
Next 'i

Temp = SortNet(odSpecFldrs.Items)
odSpecFldrs.RemoveAll
For Each sItem In Temp
odSpecFldrs(sItem) = ""
Next 'sItem
MsgBox "NameSpace Titles and" & vbCrLf & _
vbTab & "Numbers" & vbCrLf & _
Join(odSpecFldrs.Keys, vbCrLf)

'For each of the namespaces, add an array of the
' descriptions available for the items that might be
' in the namespace.
For Each sNameSpace In odSpecFldrs.Keys
odSpecFldrs(sNameSpace) = _
GetDetailDescriptions(Split(sNameSpace, ",")(1))
' If Split(sNameSpace, ",")(1) = 32 Then
' MsgBox "Namespace Title,Number = " & sNameSpace & vbCrLf & _
' "Description Count = " & _
' UBound(odSpecFldrs(sNameSpace)) + 1 & vbCrLf & _
' Join(odSpecFldrs(sNameSpace), vbCrLf)
' End If
Next 'sNameSpace

Dim saBase
saBase = ""
For Each sNameSpace In odSpecFldrs.Keys
odSpecFldrDesc(Join(odSpecFldrs(sNameSpace), vbCrLf)) = _
odSpecFldrDesc(Join(odSpecFldrs(sNameSpace), vbCrLf)) & _
sNameSpace & " "
Next 'sNameSpace

Dim saDescList
For Each saDescList In odSpecFldrDesc.Keys
sMsg = sMsg & "NameSpace List: " & vbCrLf & _
odSpecFldrDesc(saDescList) & vbCrLf & _
"Field Description List:" & vbCrLf & saDescList & vbCrLf & vbCrLf
Next 'saDescList

fOverWrite "SpecialFoldersInfo.txt", sMsg

MsgBox "Unique Descriptions count = " & odSpecFldrDesc.Count & _
vbCrLf & Join(odSpecFldrDesc.Items, vbCrLf & vbCrLf)

WScript.Quit

Function GetDetailDescriptions(iNameSpace)
'Return an array of the descriptions of the information
' available for the items in a namespace.

Dim i, sDescription
Dim oShellApp
Set oShellApp = CreateObject("Shell.Application")
Dim oShSpecFolder
Set oShSpecFolder = oShellApp.Namespace(CInt(iNameSpace))
Dim odDescriptions
Set odDescriptions = CreateObject("scripting.dictionary")
odDescriptions.comparemode = vbTextCompare

'Get the descriptions of available info
For i = 0 To 255
sDescription = oShSpecFolder.GetDetailsOf( _
oShSpecFolder.Items, i)
' MsgBox i & vbTab & sDescription & vbTab & _
TypeName(sDescription) & vbTab & isempty(sDescription) & _
vbTab & Len(sDescription)
If sDescription <> "" Then
odDescriptions(sDescription) = sDescription & "," & i
End If
Next
GetDetailDescriptions = SortNet(odDescriptions.Items)
End Function 'GetDetailDescriptions(iNameSpace)

Function SortNet(a1DArray)
Dim i
With CreateObject ("System.Collections.ArrayList")
For i = 0 To UBound(a1DArray)
.Add a1DArray(i)
Next
.Sort()
SortNet = .ToArray
End With
End Function

Sub fOverWrite(sFileName, sText)
With CreateObject("Scripting.FileSystemObject")
On Error Resume Next
.CreateTextFile(sFileName, True, False). _
Write(sText)
If Err Then 'Try Unicode file.
On Error GoTo 0
.CreateTextFile(sFileName, True, True). _
Write(Text)
End If
On Error GoTo 0
End With
End Sub




My System SpecsSystem Spec
Old 02-22-2009   #4 (permalink)
Todd Vargo


 
 

Re: w= cInt(left(info,inStr(info,"x") -1))

Paul Randall wrote:
Quote:

> "Todd Vargo" <tlvargo@xxxxxx> wrote in message
> news:OpatJKQlJHA.3868@xxxxxx
Quote:

> > "Benny Pedersen" <b.pedersen@xxxxxx> wrote in message
> >
news:4d59e483-24f0-43c2-84c7-6dec7adb9655@xxxxxx
Quote:
Quote:
Quote:

> >>
> >> We have a problem here
> >>
> >>
http://www.elementsvillage.com/forum...445#post442445
Quote:
Quote:

> >
> > Benny, the information on this page...
> >
> > http://msdn.microsoft.com/en-us/libr...70(VS.85).aspx
> >
> > indicates that valid values for iColumn of getDetailsOf method are -1
> > through 4.
> > The value of 26 seems to be out of range.
>
> Hi, Todd
> Things only seem to be something based on what we believe to be the truth.
> I think the page you reference is out of date or incomplete or just plain
> wrong.
>
> I have attached and listed below a VBScript that explores the Windows OS's
> namespaces and the columns that can be displayed when a namespace is
opened
Quote:

> as folder on the screen. It pops up two message boxes, and writes a file.
> The first message box is a list of all the namespaces and their
> corresponding namespace number. The second message box shows that many
> namespaces share the same set of columns that windows explorer can display
> for those namespaces, and groups those namespaces. The file created by
the
Quote:

> script, SpecialFoldersInfo.txt, list those groups and the column headings
> for each group. I see column numbers in the 50's.
<VBScript snipped>

The script returns this message in Windows 98.

E:\GetDetailsOfSpecialFolders.vbs(102, 1) Microsoft VBScript runtime error:
ActiveX component can't create object: 'System.Collections.ArrayList'

System.Collections.ArrayList does not seem to be valid in Windows 98.
BTW, the column information in the linked page is correct for me in Windows
98. Unfortunately, the msdn page does not identify particular OS
information.

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)

My System SpecsSystem Spec
Old 02-23-2009   #5 (permalink)
T Lavedas


 
 

Re: w= cInt(left(info,inStr(info,"x") -1))

On Feb 22, 11:19*pm, "Todd Vargo" <tlva...@xxxxxx> wrote:
Quote:

> Paul Randall wrote:
Quote:

> > "Todd Vargo" <tlva...@xxxxxx> wrote in message
> >news:OpatJKQlJHA.3868@xxxxxx
Quote:

> > > "Benny Pedersen" <b.peder...@xxxxxx> wrote in message
>
> news:4d59e483-24f0-43c2-84c7-6dec7adb9655@xxxxxx
>
Quote:
Quote:

> > >> We have a problem here
>
> http://www.elementsvillage.com/forum...445#post442445
>
>
>
Quote:
Quote:

> > > Benny, the information on this page...
>>
Quote:
Quote:

> > > indicates that valid values for iColumn of getDetailsOf method are -1
> > > through 4.
> > > The value of 26 seems to be out of range.
>
Quote:

> > Hi, Todd
> > Things only seem to be something based on what we believe to be the truth.
> > I think the page you reference is out of date or incomplete or just plain
> > wrong.
>
Quote:

> > I have attached and listed below a VBScript that explores the Windows OS's
> > namespaces and the columns that can be displayed when a namespace is
> opened
Quote:

> > as folder on the screen. *It pops up two message boxes, and writes a file.
> > The first message box is a list of all the namespaces and their
> > corresponding namespace number. *The second message box shows that many
> > namespaces share the same set of columns that windows explorer can display
> > for those namespaces, and groups those namespaces. *The file created by
> the
Quote:

> > script, SpecialFoldersInfo.txt, list those groups and the column headings
> > for each group. *I see column numbers in the 50's.
>
> <VBScript snipped>
>
> The script returns this message in Windows 98.
>
> E:\GetDetailsOfSpecialFolders.vbs(102, 1) Microsoft VBScript runtime error:
> ActiveX component can't create object: 'System.Collections.ArrayList'
>
> System.Collections.ArrayList does not seem to be valid in Windows 98.
> BTW, the column information in the linked page is correct for me in Windows
> 98. Unfortunately, the msdn page does not identify particular OS
> information.
>
> --
> Todd Vargo
> (Post questions to group only. Remove "z" to email personal messages)
System.Collections.ArrayList is a part of the dot Net framework. I
don't know if there is a framework version for Win98.

Tom Lavedas
***********
http://there.is.no.more/tglbatch/
My System SpecsSystem Spec
Old 02-23-2009   #6 (permalink)
Paul Randall


 
 

Re: w= cInt(left(info,inStr(info,"x") -1))


"Todd Vargo" <tlvargo@xxxxxx> wrote in message
news:%237QrO6WlJHA.5112@xxxxxx
Quote:

> Paul Randall wrote:
Quote:

>> "Todd Vargo" <tlvargo@xxxxxx> wrote in message
>> news:OpatJKQlJHA.3868@xxxxxx
Quote:

>> > "Benny Pedersen" <b.pedersen@xxxxxx> wrote in message
>> >
> news:4d59e483-24f0-43c2-84c7-6dec7adb9655@xxxxxx
Quote:
Quote:

>> >>
>> >> We have a problem here
>> >>
>> >>
> http://www.elementsvillage.com/forum...445#post442445
Quote:
Quote:

>> >
>> > Benny, the information on this page...
>> >
>> > http://msdn.microsoft.com/en-us/libr...70(VS.85).aspx
>> >
>> > indicates that valid values for iColumn of getDetailsOf method are -1
>> > through 4.
>> > The value of 26 seems to be out of range.
>>
>> Hi, Todd
>> Things only seem to be something based on what we believe to be the
>> truth.
>> I think the page you reference is out of date or incomplete or just plain
>> wrong.
>>
>> I have attached and listed below a VBScript that explores the Windows
>> OS's
>> namespaces and the columns that can be displayed when a namespace is
> opened
Quote:

>> as folder on the screen. It pops up two message boxes, and writes a
>> file.
>> The first message box is a list of all the namespaces and their
>> corresponding namespace number. The second message box shows that many
>> namespaces share the same set of columns that windows explorer can
>> display
>> for those namespaces, and groups those namespaces. The file created by
> the
Quote:

>> script, SpecialFoldersInfo.txt, list those groups and the column headings
>> for each group. I see column numbers in the 50's.
> <VBScript snipped>
>
> The script returns this message in Windows 98.
>
> E:\GetDetailsOfSpecialFolders.vbs(102, 1) Microsoft VBScript runtime
> error:
> ActiveX component can't create object: 'System.Collections.ArrayList'
>
> System.Collections.ArrayList does not seem to be valid in Windows 98.
> BTW, the column information in the linked page is correct for me in
> Windows
> 98. Unfortunately, the msdn page does not identify particular OS
> information.
Hi, Todd,

Tom is right. My simple array sort routine requires Dot Net. It uses one
of the few scriptable dot net objects.
The sorting was for my convenience. Just delete or comment out the sorting
routine and change the lines that use it.
For example, change:
GetDetailDescriptions = SortNet(odDescriptions.Items)
to:
GetDetailDescriptions = odDescriptions.Items

Similar changes must be made in some other places.

On this system:
W98SE
4.10.2222 A
IE 5.50.4807.2300 Update Versions:; SP2;

I get the following in my SpecialFoldersInfo.txt. The maximum column number
is less than 4 in most namespaces, but the favorites goes up to 7.

NameSpace List:
Desktop,0 Internet Explorer,1
Field Description List:


NameSpace List:
Programs,2 My Documents,5 StartUp,7 Recent,8 SendTo,9 Start Menu,11
Desktop,16 NetHood,19 Fonts,20 ShellNew,21 Start Menu,22 Programs,23
StartUp,24 Desktop,25 Application Data,26 PrintHood,27 StartUp,29 StartUp,30
Favorites,31 Temporary Internet Files,32 Cookies,33
Field Description List:
Name,0
Size,1
Type,2
Modified,3

NameSpace List:
Control Panel,3
Field Description List:
Name,0
Description,1

NameSpace List:
Printers,4
Field Description List:
Name,0
Documents,1
Status,2
Comment,3

NameSpace List:
Favorites,6
Field Description List:
Name,0
Size,1
Type,2
Modified,3
Last Visited,4
Last Modified,5
# of Visits,6
Status,7

NameSpace List:
Recycle Bin,10
Field Description List:
Name,0
Original Location,1
Date Deleted,2
Type,3
Size,4

NameSpace List:
My Computer,17
Field Description List:
Name,0
Type,1
Total Size,2
Free Space,3

NameSpace List:
Network Neighborhood,18
Field Description List:
Name,0
Comment,1

NameSpace List:
History,34
Field Description List:
Time Period,0



My System SpecsSystem Spec
Old 02-25-2009   #7 (permalink)
mr_unreliable


 
 

Re: Net Framework(s) compatible withr win98

T Lavedas wrote:
Quote:

> I don't know if there is a framework version for Win98.
>
Just for the sake of completeness, there are (at least)
three Net Frameworks which are compatible with win98.

- v1.0.2204
- v1.0.3705
- v1.1.4322

Although I must confess that (as far as I am concerned)
there is not one "all-purpose" net framework for win98.

I find that v1.1.4322 works well with the (free) vbc
"command line" vb.Net compiler and regasm to make (interop)
COM objects for use with wsh/vbs scripting. OTOH, I find
that v1.0.2204 works best with microsoft's regular
"command line" compiler (cl) to compile C or C++ code...

As one may surmise, I did not purchase visual studio.
Rather, I just used the free compilers that came with the
net framework downloads. And it is a bit of a hassle to
revise autoexec.bat (to adjust PATH, LIB, and INCLUDE)
to bring in the version of net framework that works best
with my current project.

And now for the "bad news". I strongly suspect that you
will find it extremely difficult if not impossible to ever
find these downloads currently, as microsoft has said
"sayanora" and good riddance (as far as ms was concerned,
but not me) to win98.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
the answers will be applicable to the questions)
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
"This program cannot display the web page" in WMP11 Album Info? Software
Can't get rid of "Info Icon" pop-up "This program cannot display.. Vista General
Performance Info and Tools: "page failed to load" Vista General
Any info on "SBEServer" issue in Windows Vista's Media Center? Vista music pictures video
Info: I am creating a "Powershell Information Blogging Central Project" PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46