Need Windows Explorer to open to "X":drive as opposed to My Documents?

  • Thread starter Thread starter Sleepless
  • Start date Start date
S

Sleepless

I am sorry to ask this question again but my old lappy finally died and it
is out to a friend who is trying to pull all the data from the HD...-

I want Windows Explorer to open to "X":drive as opposed to My Documents.

I know where to place the info etc, just need the syntax, any switches and
or other possibilities. Maybe a complete delineation for others would do
the most good for all who read here...

I would like the URL(s) that will give be the various syntax that will allow
me to do this. I know their were a few but I only bookmarked the most
comprehensive or the one that worked best for me. In any event, that's gone
anyway...

Or if someome has the syntax off the top of their head to get me started,
that would be great!

If possible, there was also something similar one could do (at the time I
was using W98SE) to delete the Temp files when booting up. It was a Startup
entry that I called Deltree - it went something like "Deltree y/
'C:\Windows\Temp\' " Is there something one can do that is similar for
WinXP ?

I know there are all kinds of 3rd party apps that can delete that and do an
overall housecleaning. I would just rather keep my system 'simplifed' as
overtweaking is what led to most of my problems!


Good news, this awesome Toshiba Satellite P25-S477 with the 17" screen came
with a CD-RW !!! (Not advertising, just excited!) - So now I can back all
this stuff up!

Thanks...
 
Copied old message

<QUOTE>
Subject: Re: Explorer Tree View Default
Date: Sun, 12 Aug 2001 22:41:32 +1000
From: "David Candy" <[email protected]>
Newsgroups: microsoft.public.windowsme.general

explorer [/n] [/e][,/root,object][[,/select],subobject]

None Explorer rooted at the Desktop
/n Opens a new window.
/e Explorer View (default if nothing else is on the command line.)
/root,object Starts Explorer with object the top item (normally
Desktop is the top item). Eg: explorer /e,/root,c:\Starts Explorer with the
C drive as the only drive available.
/select,subobject Selects the specified subobject.

Replaceable parameters are %1 (one) which is the short file or folder name
and %l (L) which is the long file name.

/IDLIST
This is an additional parameter that means a Windows internal structure is
being passed. eg:

Explorer.exe /e,/idlist,%I
The %I is a replacable parameter representing an IDLIST.

Rooted Views
To open an explorer item that starts with a special folder as the top folder
use the following syntax.

Where the special folder is a sub folder of the desktop

explorer /e,root,::{CLSID of special folder}

Where the special folder is a sub folder of another special folder (usually,
if not always My Computer)

explorer /e,root,::{CLSID of parent}/::{CLSID of special folder}

Where the special folder is part of the file system

explorer /e,root,path to folder

See Namespaces on the Icons Page for a list of CLSIDs for special folders.

Examples
Note that /select is inconsistent. Sometime the / is required, sometimes it
should be left out, and sometimes it doesn't matter.

Starts explorer with the Windows folder opened and selected.
explorer /e,select,c:\windows

Starts explorer with Windows the top level folder and command opened and
selected.
explorer /e,/root,c:\windows,select,c:\windows\command

Starts explorer with Windows the top level folder and Tips.txt showing
instead of the file listing.
explorer /e,/root,c:\windows,select,c:\windows\tips.txt

Starts explorer with My Computer the top level folder and all branches
except for drives collapsed.
explorer /e,/root,::{20d04fe0-3aea-1069-a2d8-08002b30309d}

Starts explorer with C:\ the top level folder.
explorer /e,/root,c:\

Starts the Dial Up Networking folder in folder view.
explorer.exe
::{20d04fe0-3aea-1069-a2d8-08002b30309d}\::{992cffa0-f557-101a-88ec-00dd010ccc48}

--

David Candy
http://www.mvps.org/serenitymacros
Free Explorer Addin -
[Screenshot] http://www.angelfire.com/biz/serenitymacros
[Details] http://www.winsite.com/bin/Info?500000002364
--------------------------------------------------------------

Bearing in mind that you can't go back 'above' the root, I'd suggest
leaving the /root section out in any regular shortcut to Explorer.
so explorer.exe /e,/select,C:\Windows
will have it open with Desktop at the top of the tree, C: open in the
right pane and 'Windows' pre-selected there, which is a good general
set up


--
Alex Nichol MVP (DTS)


Steve Barney said:
Does anyone know how to make the default view when explorer is opened so
that the C: is already expanded.
It is really anoying to have to keep manually opening it everytime!! :)


Thanks


Steve Barney
</QUOTE>
 
To delete Temp files in XP I use a shortcut to the .VBS program below in
StartUp.
You had probably command "DELTREE /Y C:\WINDOWS\TEMP\*.*" in your
Win98SE AutoExec.Bat but Windows XP doesn't use AutoExec.Bat anymore.

'DeleteTempFiles.vbs - A utility to clean Win9x temp directory
'at boot. Put a shortcut to this file in Startup directory.
'© Bill James - (e-mail address removed) - rev 04 Jan 2000
'
'Original author - Michael Harris - posted to
'microsoft.public.scripting.vbs newsgroup on 28 Aug 1999.
'
'Modifications by Bill James: Added safety check for dangerous
'temp folder settting. Revised summary popup to include
'savings for this run and cumulative savings to date.

Option Explicit

Dim fso,ws,Title
Set fso = CreateObject("Scripting.FileSystemObject")
Set ws = WScript.CreateObject("WScript.Shell")
Title = "Temp File Cleaner"

Dim TmpDir
TmpDir = ws.Environment("Process")("Temp")

ChkTmpSafe

Dim OldTmpSize
OldTmpSize = fso.GetFolder(TmpDir).size

Dim arFiles(),cnt,dcnt,Fldr,SubFldr,File
cnt = -1
dcnt = 0
DelTmpFiles TmpDir

DelEmptyFldrs TmpDir

Dim strF,strD,RptSize,TotSave

' Disabled by Eric, popup is very annoying!
'CalcSave
'If dcnt >= 1 Then ws.Popup cnt & strF & dcnt & _
' strD & vbCRLF & vbCRLF & RptSize & vbCRLF & _
' vbCRLF & TotSave,60,Title

Cleanup

Sub ChkTmpSafe
Dim Drv,Unsafe,WinDir,ComDir,PgmDir,SysDir,UnsafeDir
If TmpDir = "" Then
ws.Popup "Unsafe condition detected. %TEMP% " &_
"Variable is not set.",60,Title,16
Cleanup
WScript.Quit
End If
If Not fso.FolderExists(TmpDir) Then
fso.CreateFolder(TmpDir)
Cleanup
WScript.Quit
End If
For Each Drv In(fso.Drives)
If Drv.DriveType = 2 or Drv.DriveType = 3 Then _
UnSafe = UnSafe & Drv.RootFolder & "|"
Next
Unsafe = Unsafe & fso.GetSpecialFolder(0) & "|"
Unsafe = Unsafe & fso.GetSpecialFolder(0) & "\Command|"
Unsafe = Unsafe & ws.RegRead("HKLM\Software\Microsoft" _
& "\Windows\CurrentVersion\ProgramFilesPath") & "|"
Unsafe = Unsafe & fso.getspecialfolder(1)
Unsafe = Split(Unsafe,"|",-1,1)
For Each UnsafeDir In Unsafe
If UCase(UnsafeDir) = UCase(TmpDir) Or _
UCase(UnsafeDir) & "\" = UCase(TmpDir) Or _
UCase(UnsafeDir) = UCase(TmpDir) & "\" Then
ws.Popup "Unsafe condition detected. %TEMP% " &_
"Variable is set to " & TmpDir,60,Title,16
Cleanup
WScript.Quit
End If
Next
End Sub

Sub DelTmpFiles(FldrSpec)
Set Fldr = fso.GetFolder(FldrSpec)
For Each File In Fldr.Files
cnt = cnt + 1
Redim Preserve arFiles(cnt)
Set arFiles(cnt) = File
Next
For Each SubFldr in Fldr.SubFolders
DelTmpFiles SubFldr
Next
For Each file in arFiles
On Error Resume Next
file.Delete True
If Err.Number = 0 Then dcnt = dcnt + 1
Err.Clear
Next
End Sub

Sub DelEmptyFldrs(FldrSpec)
Set Fldr = fso.GetFolder(FldrSpec)
For Each SubFldr in Fldr.SubFolders
DelEmptyFldrs SubFldr
Next
On Error Resume Next
If UCase(Fldr.Path) <> UCase(TmpDir) Then
If Fldr.Files.Count = 0 Then
If Fldr.SubFolders.Count = 0 Then
Fldr.Delete
End If
End If
End If
If Err.Number = 76 Then
Err.Clear
On Error GoTo 0
DelEmptyFldrs(TmpDir)
End If
End Sub

Sub CalcSave
Dim NewTmpSize,SaveSize,s1,s2
Dim TmpClnLog,OldSave,HideLog,Log
NewTmpSize = fso.GetFolder(TmpDir).size
SaveSize = OldTmpSize - NewTmpSize
s1 = " free space reclaimed."
If SaveSize < 1024 Then
RptSize = SaveSize & " bytes" & s1
ElseIf SaveSize < 1048576 Then
RptSize = Round(SaveSize / 1024) & " KB" & s1
Else RptSize = Round(SaveSize / 1048576) & " MB" & s1
End If
Log = fso.GetSpecialFolder(0) & "\TempClean.Log"
If Not fso.FileExists(Log) Then fso.CreateTextFile(Log)
If fso.GetFile(Log).Size = 0 Then
Set TmpClnLog = fso.OpenTextFile(Log,8,True)
TmpClnLog.WriteBlankLines(1)
End If
Set TmpClnLog = fso.OpenTextFile(Log,1)
OldSave = TmpClnLog.ReadLine
If Not IsNumeric(OldSave) Then OldSave = 0
TotSave = OldSave + SaveSize
Set TmpClnLog = fso.OpenTextFile(Log,2)
TmpClnLog.WriteLine TotSave
TmpClnLog.Close
s2 = " reclaimed to date."
If TotSave < 1024 Then
TotSave = TotSave & " bytes" & s2
ElseIf TotSave < 1048576 Then
TotSave = Round(TotSave / 1024) & " KB" & s2
Else TotSave = Round(TotSave / 1048576) & " MB" & s2
End If
cnt = cnt + 1
If cnt = 1 Then strF = " file found, " _
Else strF = " files found, "
If dcnt = 1 Then strD = " file deleted." _
Else strD = " files deleted."
Set TmpClnLog = Nothing
End Sub

Sub Cleanup
Set fso = Nothing
Set ws = Nothing
Set Fldr = Nothing
End Sub
 
Yes you can copy the text for the .VBS program and save it as
nameyouwant.VBS

I commented out the part (just a few lines) that shows a popup reporting
how many bytes have been deleted, but you could restore that again by
removing the ',s before the program text (not before an comment line).
 
Thanks Eric,

You have been a great help! Not only did you get me what I needed, but also
explanations and examples so I can internalize some of the variations, and
if not explicit, I can derive and glean more from context. It's often
difficult to remember and understand just a step-by-step, "Do this"
approach(although sometimes that IS neded for some people). When otherwise
presented, retaining and assimilating works so much better for me.

Thanks,

Sleepless
 
This is great but how can I open windows explorer with
just 'My Computer' expanded? How can I get rid of My
Documents at the top of the list (permanently). Also how
can I get the 'Status Bar' to remain every time I open
windows explorer in XP? MM....
Cheers
Stumped
-----Original Message-----
Hi

To create a desktop shortcut to open Windows Explorer with the C: drive expanded:

Right click the Desktop and select New>Shortcut. In the
first screen that appears type the following:
%systemroot%\EXPLORER.EXE /e,c:

click Next, name the shortcut whatever you what and then
click Finish. Replace the 'c:' - in the shortcut - with
the drive that you like.
 
BenV said:
This is great but how can I open windows explorer with
just 'My Computer' expanded? How can I get rid of My
Documents at the top of the list (permanently). Also how
can I get the 'Status Bar' to remain every time I open
windows explorer in XP? MM....
Cheers
Stumped

first screen that appears type the following:
click Finish. Replace the 'c:' - in the shortcut - with
the drive that you like.

I can't answer all your questions, but I can answer a couple of them: To
have Windows Explorer default to a certain drive/folder do this:

1) Right-click on the shortcut you use to open Windows Explorer.
2) Choose "Properties" from the popup menu
3) Click on the "Shortcut" tab
4) Next to the entry which says "Target:", enter this at the END of the
commandline: a space character, then "/e,", a space character, then "/n,",
a space character, then "D:\Dir\Subdir" (where "D:\Dir\SubDir" is the drive
and folder you want Explorer to open to whenever you start it.) Do not
enclose the additions in quotes, as I have. The finished commandline should
look like this: "%SystemRoot\explorer.exe /e, /n, D:\Dir\SubDir". As an
example, mine looks like this: "%SystemRoot\explorer.exe /e, /n, C:\" Don't
forget the space after the "explorer.exe", or you will be unable to save the
shortcut.
5) Click on "Apply"
6) Click on "Ok"


You won't be able to get rid of My Computer, as far as I know, but the above
entry will always default to the drive and directory you want being selected
and expanded when you start Explorer using that shortcut.

Do the same to all your Windows Explorer shortcuts, or they will default to
the original style. (Hint: You can have any number of shortcuts to Windows
Explorer, with different default folders).

I got the following from Windows XP Help and Support by entering the phrase
"Windows Explorer switches", and selecting #5 from the list of articles
displayed under "Microsoft Knowledge Base"

Add Windows XP to the list of OS's the following article apply to.
Windows Explorer Command-Line Options
The information in this article applies to:
a.. Microsoft Windows 2000 Server
b.. Microsoft Windows 2000 Advanced Server
c.. Microsoft Windows 2000 Professional
d.. Microsoft Windows 2000 Datacenter Server
e.. Microsoft Windows NT Workstation 4.0
f.. Microsoft Windows NT Server 4.0
This article was previously published under Q152457
SUMMARY
This article lists the command-line switches that you can use with Windows
Explorer (Explorer.exe).
MORE INFORMATION
Explorer [/n] [/e] [(,)/root,<object>] [/select,<object>]

/n Opens a new single-pane window for the default
selection. This is usually the root of the drive Windows
is installed on. If the window is already open, a
duplicate opens.

/e Opens Windows Explorer in its default view.

/root,<object> Opens a window view of the specified object.


/select,<object> Opens a window view with the specified folder, file or
application selected.

Examples:

Example 1: Explorer /select,C:\TestDir\TestApp.exe

Opens a window view with TestApp selected.

Example 2: Explorer /e,/root,C:\TestDir\TestApp.exe

This opens Explorer with C: expanded and TestApp selected.

Example 3: Explorer /root,\\TestSvr\TestShare

Opens a window view of the specified share.

Example 4: Explorer /root,\\TestSvr\TestShare,select,TestApp.exe

Opens a window view of the specified share with TestApp selected.--
Donald L McDanielPost All replies to the Newsgroup, so that all may be
informed=============================================================
 
Back
Top