Re: open parent directories

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Marc (anonymous_at_microsoft.com)
Date: 09/30/04


Date: Thu, 30 Sep 2004 04:16:03 +0200

With Helge's help I finally found a way to add the command "Open parent folder" to the context menu. :-D

1. I put the following script on C:\

Name of the script: "OpenParentFolder.vbs"
'------------------------------------------
set WshShell = WScript.CreateObject("WScript.Shell")
ShortcutFile = WScript.Arguments(0)
set oShellLink = WshShell.CreateShortcut(ShortcutFile)
WshShell.Run "%windir%\explorer.exe /n,/e,""" & _
oShellLink.WorkingDirectory & """"
'------------------------------------------

2. Then I made these entries in the registry:

Key:
HKCR\lnkfile\shell\ParentFolder
Value:
Open parent folder

Key:
HKCR\lnkfile\shell\ParentFolder\Command
Value:
"C:\windows\system32\wscript.exe" "C:\OpenParentFolder.vbs" "%1"

Bye,
Marc



Relevant Pages

  • Re: Split my logon script
    ... Tell him that he can and should run the script ... in context of the present. ... used to be - separate files ... Set WshShell = CreateObject ...
    (microsoft.public.scripting.wsh)
  • Re: vbscript runonce key
    ... runonce key again to run the batch file and reboot the script runs all the ... Instead of invoking the script directly, ... Dim objComputer, strModel, strMfg, WshShell, oExec, strCommand ... Set WshShell = CreateObject ...
    (microsoft.public.scripting.vbscript)
  • Re: vbscript runonce key
    ... Instead of invoking the script directly, ... Dim objComputer, strModel, strMfg, WshShell, oExec, strCommand ... Elseif strModel = "OptiPlex 745" Then ... Set WshShell = CreateObject ...
    (microsoft.public.scripting.vbscript)
  • Re: regedit quickie
    ... Set WSHShell = WScript.CreateObject ... 'End Script ... Doug Knox, MS-MVP Windows XP/9x ... > Tried your script but gets the message:> Invalid root in registry key. ...
    (microsoft.public.windowsxp.security_admin)
  • VBScript error on XP Embedded
    ... I'm fairly new to XP Embedded so excuse my stupidity. ... Dim isRunning ... Set wshShell = WScript.CreateObject ...
    (microsoft.public.windowsxp.embedded)