' QExplorer.vbs ' ' QExplorer installs/uninstalls by double-clicking the file, copying or deleting ' QExplorer to/from your %windir%, and creating or deleting two HKCR registry ' keys. Unistall leaves nothing on your system. ' ' After installation right-click a folder or file in Windows Explorer and ' select QExplorer from the context menu. A new shortcut will be created on ' the Quick Launch bar or Desktop with a My Computer icon and a Tool Tip that ' reads something like the following: ' ' QExplore 'C·Program Files·My Projects·My Folder' ' ' QExplorer creates a shortcut entitled "QExplore 'My Computer' for you upon ' installation. ' ' If you examine the new shortcut's "Properties" you will see a "Target" of ' "C:\Windows\EXPLORER.EXE /e,/select,C:\". The command-line switches ' "/e,/select,C:\" opens Windows Explorer in the parent of the selected ' folder "C:\", which is "My Computer". ' ' With command-line switches of "/e,C:\", Windows Explorer opens to "C:\". ' Since you will most likely want the folder you select to be the one to be ' opened, QExplorer's shortcuts won't incorporate a "/select," command-line ' switch. Here endeth the lesson. ' On Error Resume Next Set ws = WScript.CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") Set args = WScript.Arguments ''' No arguments means QExplore.vbs will be installed or uninstalled. If args.Count = 0 Then If IsObject(ws.RegRead("HKCR\*\shell\QExplorer\")) Then If Left(Err.Description, 12) = "Invalid root" Then fso.CopyFile WScript.ScriptFullName, ws.ExpandEnvironmentStrings("%windir%\QExplorer.vbs") ws.RegWrite "HKCR\*\shell\QExplorer\", "" ws.RegWrite "HKCR\*\shell\QExplorer\command\", _ "C:\Windows\WScript.exe C:\Windows\QExplorer.vbs ""%1""" ws.RegWrite "HKCR\Directory\shell\QExplorer\", "" ws.RegWrite "HKCR\Directory\shell\QExplorer\command\", _ "C:\Windows\WScript.exe C:\Windows\QExplorer.vbs ""%1""" ql = ws.ExpandEnvironmentStrings("%windir%\Application Data\Microsoft\Internet Explorer\Quick Launch") If fso.FolderExists(ql) Then scp = ql + "\" Else scp = ws.SpecialFolders("Desktop") + "\" End If Set oLink = ws.CreateShortcut(scp + "QExplore 'My Computer'.lnk") oLink.TargetPath = ws.ExpandEnvironmentStrings("%windir%\EXPLORER.EXE") oLink.Arguments = "/e,/select,C:\" oLink.IconLocation = ws.ExpandEnvironmentStrings("%windir%\EXPLORER.EXE, 0") oLink.WindowStyle = 3 oLink.Description = "Shortcut Script" oLink.WorkingDirectory = "My Computer" oLink.Save bMsg = "QExplorer installed!" + vbCRLF + vbCRLF bMsg = bMsg + "Right-click a folder or file in Windows Explorer and" + vbCRLF bMsg = bMsg + "select QExplorer from the contect menu to create a" + vbCRLF bMsg = bMsg + "new Quick Launch Shortcut." + vbCRLF + vbCRLF bMsg = bMsg + "ie: Click the new QExplore 'My Computer' icon." bMode = vbSystemModal + vbInformation + vbOKOnly bTitle = "QExplorer Installation" MsgBox bMsg, bMode, bTitle WScript.Quit Else WScript.Quit End If Else fso.DeleteFile ws.ExpandEnvironmentStrings("%windir%\QExplorer.vbs"), True ws.RegDelete "HKCR\*\shell\QExplorer\" ws.RegDelete "HKCR\Directory\shell\QExplorer\" bMsg = "QExplorer uninstalled!" bMode = vbSystemModal + vbInformation + vbOKOnly bTitle = "QExplorer Uninstallation" MsgBox bMsg, bMode, bTitle WScript.Quit End If End If ''' Get the path dropped on QExplorer. arg = args(0) ''' Quick Launch (Taskbar) or Desktop. ql = ws.ExpandEnvironmentStrings("%windir%\Application Data\Microsoft\Internet Explorer\Quick Launch") If fso.FolderExists(ql) Then scp = ql + "\" Else scp = ws.SpecialFolders("Desktop") + "\" End If ''' If a file was selected, select the folder instead. If fso.FileExists(arg) Then Set f = fso.GetFile(arg) arg = Left(arg, Len(arg) - (Len(f.Name) + 1)) End If ''' Build the shortcut's title. ie: QExplore 'C·Folder·Folder' sct = Replace(arg, ":", "") sct = Replace(sct, "\", "·") ''' Create the QExplorer residence path, the Taskbar or the Desktop. Set oLink = ws.CreateShortcut(scp + "QExplore '" + sct + "'.lnk") oLink.TargetPath = ws.ExpandEnvironmentStrings("%windir%\EXPLORER.EXE") oLink.Arguments = "/e," + """" + arg + """" oLink.IconLocation = ws.ExpandEnvironmentStrings("%windir%\EXPLORER.EXE, 0") oLink.WindowStyle = 3 oLink.Description = "Shortcut Script" oLink.WorkingDirectory = arg oLink.Save