中国DOS联盟论坛

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-12 09:32
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » [Completed] Help me correct the VBS code to open the location of the shortcut
Printable Version  2,670 / 25
Floor16 slore Posted 2009-08-05 13:21
铂金会员 Posts 2,478 Credits 5,212
Set args = WScript.Arguments
linkname = args(0)
Set wshshell = CreateObject("WScript.Shell")
Set scut = wshshell.CreateShortcut(linkname)
Set fs = CreateObject("Scripting.FileSystemObject")
folder = fs.GetParentFolderName(scut.TargetPath)
If Left(folder,1) <> """" Then folder = """" & fs.GetParentFolderName(scut.TargetPath) & """"
wshshell.Run("explorer " & folder)
Floor17 kidzgy Posted 2009-08-05 21:25
中级用户 Posts 129 Credits 262

Still the same, I think there is a problem in the 4th line, it should be where to judge whether there are double quotes

This is the diagram of my shortcut


[ Last edited by kidzgy on 2009-8-6 at 08:27 ]
Floor18 kidzgy Posted 2009-08-06 22:52
中级用户 Posts 129 Credits 262
http://upload.cn-dos.net/img/1638.zip
This is a Thunderbolt shortcut, you can give it a try.
Floor19 slore Posted 2009-08-07 00:41
铂金会员 Posts 2,478 Credits 5,212
Floor20 kidzgy Posted 2009-08-07 07:45
中级用户 Posts 129 Credits 262
Then there is no way to solve it. Then is this program only applicable to paths without double quotes?
Floor21 slore Posted 2009-08-07 08:06
铂金会员 Posts 2,478 Credits 5,212
It runs normally whether I have it here or not.
Floor22 kidzgy Posted 2009-08-07 08:15
中级用户 Posts 129 Credits 262
Then it's really strange. What on earth could be the problem? I need to go to an internet café to try it when I have time.
Floor23 kidzgy Posted 2009-08-07 08:44
中级用户 Posts 129 Credits 262




I understand.

The type of my Thunderbolt shortcut is essentially the same as the shortcut for creating a broadband connection in the network connection.

And when I package it into a ZIP and then extract it, it forms the same as the shortcut for sending the main program to the desktop by right-clicking.

For example, in the figure, I use the new RAR to open and look at the desktop, and only see the icon of the Thunderbolt shortcut lnk, while the broadband connection and another Thunderbolt are not visible. Here, it also shows that the essence of the other Thunderbolt and the broadband connection shortcut is the same, but different from the shortcut sent to the desktop. Therefore, such an error occurs.

In fact, even if it is enclosed in double quotes, there is no need to modify it, because the one fixed on the 5th floor originally can already be used.
Floor24 kidzgy Posted 2009-08-07 08:47
中级用户 Posts 129 Credits 262
Like the prompt that pops up on the 17th floor, it's because I'm dealing with a shortcut created by the system registry, not a shortcut with a filename ending in .lnk for the right-click.
Floor25 slore Posted 2009-08-07 12:42
铂金会员 Posts 2,478 Credits 5,212
You can't see it not because of this reason... It's because they are not in this directory...

The desktop is that all users and your own desktop are displayed together...

You should be able to see it from the regular properties
Floor26 kidzgy Posted 2009-08-07 22:16
中级用户 Posts 129 Credits 262
Oh, I see.
Prev  1 2
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023