Sometimes you often open a folder where a file is located, go to other files, such as the tool directory to open the VC, running without the program in the Start menu, or modify a program profile. For shortcuts, the general approach is to right-click on the shortcut, open the shortcut properties, and enter the folder in the Find Target. The VB Script listed below will open the folder where the shortcut target file is located. By modifying the registry, you can add the Open Folder item on the right-click menu to call this script. / ***********************Open_SHRTCT_PARENT_FOLDER.VBS******************************** ******** / set args = wscript.ArgumentsLinkName = args (0)
Set wshshell = creteObject ("wscript.shell")
Set scut = wshshell.createshortcut (linkname)
Set fs = creteObject ("scripting.filesystemobject")
Folder = "" "" & fs.getParentFoldername (Scut.TargetPath) & "" ""
Wshshell.run (folder) / *********************** OPEN_SHRTCT_PARENT_FOLDER.VBS **************** ************** // *********************** LNK.REG ******* ************************* / Windows Registry Editor Version 5.00
[HKEY_CLASS_ROOT / LNKFILE / Shell]
[HKEY_CLASS_ROOT / LNKFILE / Shell / Open Folder]
[Hkey_classes_root / lnkfile / shell / open folder / command] @ = "wscript.exe /"f: //scripts//open_shrtct_parent_folder.vbs/"% l / ""
/******************************************************************************************************** **** / Note: 1. Please modify the above F: //Scripts//open_shrtct_parent_folder.vbs to actually store the path to Open_SHRTCT_PARENT_FOLDER.VBS. 2. Don't copy / ***** / row. The speed of the script is still a bit slow, there is a bit of a big delay on the test, but it also has a fast. In fact, I have been using C / C , which is not familiar with VB and Script. Who is interested in writing a registered script directly.