Make ANY Folder The Root Of Windows Explorer

By | 2002-06-01

My Code calls The Windows Explorer with the switch “e,/root,” and makes any folder you want the root of the windows explorer

Original Author: Jim

Side Effects

It’s a little slow calling the explorer cause i shell it, if you know better please edit at will

Code

'it's a module
'i went a little DIM crazy with the
'variables but it's still good code...enjoy
Public Sub eRoot(rootpath As String, fldrs As Boolean)
'fldrs is the folders switch, monkey with it and see what you get
On Error Resume Next
Dim EX, ARGU, path, X
If fldrs = True Then
EX = "explorer.exe"
ARGU = " /e,/root, "
path = rootpath$
X = Shell(EX & ARGU & path, 1)
ElseIf fldrs = False Then
EX = "explorer.exe"
ARGU = " n/e,/,root, "
path = rootpath$
X = Shell(EX & ARGU & path, 1)
End If
End Sub

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.