我在 VBScript 中找不到任何可以替换 %~dp0 的东西
On error resume next
Set shell= createobject("WSCRIPT.SHELL")
Shell.run "%~dp0test.bat", vbhide
最佳答案
Set fso = CreateObject("Scripting.FileSystemObject")
GetTheParent = fso.GetParentFolderName(Wscript.ScriptFullName)
取自这里:
要在脚本中使用获得的值,请在需要其值的地方添加对变量的引用。例如:
Shell.run GetTheParent & "\test.bat", vbhide
关于batch-file - 在 VBScript 中替换 %~dp0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14677199/