![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-04 04:18 |
48,038 topics / 350,123 posts / today 0 new / 48,251 members |
| DOS批处理 & 脚本技术(批处理室) » Open the target folder → VBS version |
| Printable Version 2,484 / 15 |
| Floor1 baomaboy | Posted 2007-03-18 04:05 |
| 银牌会员 Posts 554 Credits 1,513 | |
|
Just a little trick,
Conveniently and quickly open the target folder of the desktop shortcut. http://zhenlove.com.cn/cndos/fileup/files/Open_Shortcut_Parent_Folder.rar [ Last edited by baomaboy on 2007-3-18 at 04:06 AM ] |
|
| Floor2 baomaboy | Posted 2007-04-11 06:20 |
| 银牌会员 Posts 554 Credits 1,513 | |
Dim WshSHell,FSO [ Last edited by baomaboy on 2008-3-25 at 01:03 AM ] |
|
| Floor3 baomaboy | Posted 2007-04-11 06:22 |
| 银牌会员 Posts 554 Credits 1,513 | |
|
Found a script using WMI
'========================================================================== [ Last edited by baomaboy on 2008-3-25 at 01:04 AM ] |
|
| Floor4 baomaboy | Posted 2007-04-11 06:25 |
| 银牌会员 Posts 554 Credits 1,513 | |
|
There is another one. Hey, it's similar to the code on the second floor. I won't post it.
[ Last edited by baomaboy on 2007-4-11 at 06:27 AM ] |
|
| Floor5 everest79 | Posted 2007-04-11 06:30 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
Is using this line simpler? explorer /select,%1
|
|
| Floor6 baomaboy | Posted 2007-04-11 11:55 |
| 银牌会员 Posts 554 Credits 1,513 | |
Originally posted by everest79 at 2007-4-11 06:30: everest79 may not have looked carefully. What needs to be opened is not the directory where the LNK is located, but the directory pointed to by the LNK. Picture Thunder.lnk, you opened the desktop, I opened C:\Program Files\Thunder And I don't feel that the code is complicated. For example, the code on the third floor, the main idea is also like brother, just one line of explorer /select,%1 But the person who wrote the code did it for use rather than to tell a technology or trick, so there are those seemingly complicated and useless codes. Because he didn't want to change the registry to implement installation again, and to pass the obtained path parameters. In short, the seemingly useless code is piled up. This is my guess about the original author's thoughts. I think he should also understand that the line explorer /select,%1 is simpler... [ Last edited by baomaboy on 2007-4-11 at 12:39 PM ] |
|
| Floor7 everest79 | Posted 2007-04-11 15:11 |
| 金牌会员 Posts 1,127 Credits 2,564 | |
|
I misread it.
|
|
| Floor8 zh159 | Posted 2007-04-11 16:24 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
|
May I ask baomaboy if it's possible to use VBS to obtain the image resolution and size (jpg, gif, bmp) (script)
|
|
| Floor9 kich | Posted 2007-04-12 22:23 |
| 中级用户 Posts 168 Credits 397 | |
|
I want to ask here:
Folder = """" & FSO.GetParentFolderName(Scut.TargetPath) & """" WshSHell.Run(Folder) Then the quotes, is it okay to use any number of them? Or do they need to appear in even numbers?? How many do I need so that the program doesn't report an error?? Thx |
|
| Floor10 baomaboy | Posted 2007-04-13 07:47 |
| 银牌会员 Posts 554 Credits 1,513 | |
Originally posted by zh159 at 2007-4-11 16:24: Currently, only the file size can be obtained using fso.size. As for the resolution.... If I find out later, I will definitely add it later ^_^. |
|
| Floor11 baomaboy | Posted 2007-04-13 07:58 |
| 银牌会员 Posts 554 Credits 1,513 | |
Originally posted by kich at 2007-4-12 22:23: Not just any, and not an even number, but follow the rules. In VBS, if the " symbol really needs to appear in the string, use two " symbols to represent it. As long as this rule is followed, it's okay. For example, Folder = """" The " symbols at both ends of the "" just indicate that the middle is a string value. The two " in the middle are the main body (one "), that is, Folder = " [ Last edited by baomaboy on 2007-4-13 at 07:59 AM ] |
|
| Floor12 3742668 | Posted 2007-04-13 08:34 |
| 荣誉版主 Posts 718 Credits 2,013 | |
Found a method using WMI... Using the powerful Shell.Application can also achieve: The limitation of this method is that it simply reads the path at the "start position". If you want to get the directory name more reliably, you can use oLink.Path to get the source file, and then separate the directory. In addition, you can also use Adodb.Stream to read the binary stream to get the information you need. (The code is omitted, you just need to know that the format of Lnk can easily write the corresponding code. If needed, you can refer to the famous <The_Windows_Shortcut_File_Format.pdf>) Attachments The_Windows_Shortcut_File_Format.pdf (43.98 KiB) |
|
| Floor13 3742668 | Posted 2007-04-13 08:44 |
| 荣誉版主 Posts 718 Credits 2,013 | |
Originally posted by zh159 at 2007-4-11 16:24: Method 1, using the LoadPicture function: Method 2, using the powerful Shell.Application component: Method 3, using Adodb.Stream to read the binary stream for analysis: Method one is undoubtedly the simplest, but the information that can be obtained is also the least. Method two is relatively moderate. Compared with method one, more information can be obtained, and the interactivity is relatively stronger. Method three should be the most flexible. The disadvantage is that various formats of images need to be processed separately, which requires more understanding of various formats. |
|
| Floor14 baomaboy | Posted 2007-04-13 08:46 |
| 银牌会员 Posts 554 Credits 1,513 | |
|
The code and the book have both been collected. Thanks. I wonder if the book contains the LNK format of Office (non-self-built LNK). The path bar in its properties has no available information and is in a grayed-out and unavailable state.
|
|
| Floor15 baomaboy | Posted 2007-04-13 08:49 |
| 银牌会员 Posts 554 Credits 1,513 | |
Originally posted by 3742668 at 2007-4-13 08:44: |
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |