简体   繁体   中英

Using Wildcards in VBA Shell Command

I am using the Shell_ command in VBA. Are there wildcards allowed with this command? If so what are they?

EX:

Shell_ """C:\Program Files\ProgHere\Prog Here v *.*\Prog Here Mini\prog.exe"""

No. The path is simply passed directly to the shell to execute, and the shell can't execute a path with wildcards in it.

What you can do is use the Dir command first (which does allow wildcards) to get the filename you want, then execute it: http://msdn.microsoft.com/en-us/library/dk008ty4%28v=vs.90%29.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM