Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetSpecialFolder fonts,desktop ECT 2

Status
Not open for further replies.

PWise

Programmer
Dec 12, 2002
2,633
US
In the version of VB scripting help file that I have the GetSpecialFolder method can only return three folders.
0-windows
1-system
2-temp

I remember a method that returned other folders like the desktop, fonts ect.
I think that there were 13 folders can someone remind what method that was.

Thank you

 
Paraphrased from MSDN...

Code:
Dim oWSH
Dim strDesktop
set oWSH = WScript.CreateObject("WScript.Shell")
strDesktop = oWSH.SpecialFolders("Desktop")

Values:
AllUsersDesktop
AllUsersStartMenu
AllUsersPrograms
AllUsersStartup
Desktop
Favorites
Fonts
MyDocuments
NetHood
PrintHood
Programs
Recent
SendTo
StartMenu
Startup
Templates

HtH, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
THANKS BOB
1) CAN WE RETRIVE THESE FOLDERS BY INDEX # ?
2) WHERE CAN I GET A REFRANCE TO THE WHOLE WSCRIPT.SHELL OBJECT?
 
PMFJI, but you can retrieve the folders by index. Try

Dim oWSH
Dim strDesktop
Dim nCounter
Set oWSH = WScript.CreateObject("WScript.Shell")
For Each strDesktop In oWSH.SpecialFolders
WScript.Echo strDesktop
Next
For nCounter = 0 To oWSH.SpecialFolders.Length - 1
WScript.Echo oWSH.SpecialFolders(nCounter)
Next Jon Hawkins
 
Doh!

Didn't think of that, Jon. Good work!

Later, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
thanks again to both of you
pwise
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top