![]() |
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-09-23 14:46 |
47,812 topics / 349,917 posts / today 0 new / 48,273 members |
| DOS批处理 & 脚本技术(批处理室) » VBS: How to handle directories with dots |
| Printable Version 1,990 / 1 |
| Floor1 wewebb | Posted 2010-12-28 21:14 |
| 初级用户 Posts 53 Credits 66 | |
|
For example, a malformed directory with a dot, such as: MD C:\Folder...\ ,in CMD it is displayed as C:\Folder..
Using GetFolder in VBS is invalid: set sh=CreateObject("Wscript.Shell") set FSO=CreateObject("Scripting.FileSystemObject") For each i in Wscript.Arguments Set FO=FSO.GetFolder( i ) 'This step often goes wrong, can't find the path Sh.Run "Explorer " & FO.ShortPath 'Open with the short path of the directory Next [ Last edited by wewebb on 2010-12-28 at 21:19 ] |
|
| Floor2 slore | Posted 2010-12-29 09:54 |
| 铂金会员 Posts 2,478 Credits 5,212 | |
|
Can't this work directly?
Sh.Run "Explorer " & i & "." 'Open with short path of directory method |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |